roshan@blog:~$
Linux LinuxOperationsTroubleshooting

TECHNICAL STUFF

 ·  Roshan Nagekar  ·  5 min read

Some rights reserved by Arthur Caranta

TECH STUFF

  1. to separate a part of pdf from the original pdf use the following command, u may need to install pdftk “pdftk old.pdf cat 1-9 26-end output new.pdf”
  2. get all the packages installed in the PC
  3. aptitude search '!~M ~i' | awk -F " " '{ print "apt-get -y install " $2 }' > aptshell.sh

    • to load dropbox ~/.dropbox-dist/dropboxd

    • ps command

    Type the following ps command to display all running process

    ps aux | less

    Where,

     -A: select all processes

        a: select all processes on a terminal, including those of other users
        x: select processes without controlling ttys
    Task: see every process on the system
    

    ps -A

    ps -e

    Task: See every process except those running as root

    ps -U root -u root -N

    Task: See process run by user vivek

    ps -u vivek

    • Task: top command

    The top program provides a dynamic real-time view of a running system. Type the top at command prompt

    top

    • Task: display a tree of processes

    • pstree shows running processes as a tree. The tree is rooted at either pid or init if pid is omitted. If a user name is specified, all process trees rooted at processes owned by that user are shown.

    $ pstree

    • --max-depth=, which instructs du to list its subdirectories and their sizes to any desired level of depth (i.e., to any level of subdirectories) in a directory tree. For example, the following would cause du to list only the first tier (i.e., layer) of directories in the current directory and their sizes (inclusive of all of their contents, including those of their subdirectories): du --max-depth=1

    The total space consumption for the current directory tree will also be reported, and it will, of course, be the same regardless of the depth of the files listed.

    Setting --max-depth= to zero tells du to not list any of the subdirectories within the selected directory, i.e., to list only report the size of the selected directory itself. The result is the same as using the -s option.

    • wget to download anu file online
    wget <url>
    wget <url> -t 'n'
    -t will make n number of trials... useful at the times of broken downloads.
    
    1. HOWTO: ISO creation from terminal
    2. Hi, I was looking for this (for a BASH script I wanted to write), and I found out how to do it. Now I want to share it

      1. Create ISO-file from folder
      2. Code:

        mkisofs -r -o /isofile.iso /folder

        where /isofile.iso is the relative or absolute path to the iso-file you want to create and /folder the absolute or relative path to the folder you want to backup.

        1. Create ISO-file from file(s)
        2. Code:

          mkisofs -r -o /isofile.iso /mybigfile


          or if you want to backup multipi files (like you .mp3 collection)

          Code:

          mkisofs -r -o /isofile.iso *.mp3

          1. Create ISO-file from a cd/dvd-drive
          2. Code:

            dd if=/dev/cdrom0 of=isofile.iso where /dev/cdrom0 is your cd/dvd-drive and isofile.iso your iso-file you want to create.

            Note: An absolute path is like '/home/yn/myfile.iso', a relative path is like 'myfile.iso'


            1. âž™ Synchronize all your files across Windows, Linux and Mac OS with Dropbox (2GB free storage!). By signing up via this link I'll get some extra space also, thanks!
            2. command for generation of preprocessed code which will have the included files in the code as well as the code that we have written
            3. gcc -E test.c > test.pp
              

              object code post compilation that we always do.

              gcc test.c test2.c -o test.o
              

              the assembly dump of the code generated. objdump -d test.o

              test.c -> #include <stdio.h>

              #include <stdlib.h> double add(int,int); int main()

              {
              printf("%f\n", add(1,2));
              return 0;
              }
              

              test2.c -> #include <stdio.h>

              double add(int a, int b)

              {
              
              printf("%f\n", (double)(a + b));
              
              return a + b;
              
              }
              
              1.  How to get all log history for the so called branches in subversion (they are nothing more than directories)

                 mkdir ORACLEPOC; cd ORACLEPOC; svn2git
                svn://[110.0.0.10/idbl//UI/ORACLEPOC](http://110.0.0.10/idbl//UI/ORACLEPOC) --rootistrunk --verbose; cd ..
                
                1.  Count total number of commits in all UI branches:

                  grepping on "Date:" total=0;for i in *;  do cd $i; echo In $i; total=`expr $total + $(git

                  log | grep "Date:" | wc -l)`; cd ..; done; echo $total
                  

                  15. 

                  Merge two branches  (that are in different repositories) into one.

                  git remote add MSSQL_2.3  /home/git/MSSQL_2.3
                  git pull MSSQL_2.3 master:b
                  git merge b
                  git branch -d
                  
                  1. Linux / Unix Command: chage
                    Command Library

                    NAME

                    chage - change user password expiry information 


                    SYNOPSIS

                    chage

                    : [-mmindays] [-Mmaxdays] [-dlastday] [-Iinactive]  [-Eexpiredate] [-Wwarndays] user

Enjoyed this post?

I write about DevOps, cloud, and occasionally CRO. Follow along on Twitter for more.

Follow @iamrawtion Subscribe via RSS Connect on LinkedIn Follow on GitHub

Related Posts

Linux

Install Cobbler 2.6.10 on Ubuntu 14.04

2016

Linux

Bugzilla Mail Sending Issue

2014

Linux

Install a Patched Ruby Interpreter With Rbenv and Ruby-build for 2.0.0-p247

2014