Musings

A random collection

TECH: Simple Tricks on Linux

  1. Inserting a file in place of a pattern in another file
    # keep the line alongwith the pattern
    sed '/PATTERN/ r filename' inputfile > outputfile
    
    # replace the line with the pattern
    sed '/PATTERN/ {
      r filename
      d
    }' inputfile > outputfile
    

    Reference: http://www.grymoire.com/Unix/Sed.html

  2. GDM Console Root Login
  3. Setting up Caching DNS Server on Fedora
  4. wget — login page processing
  5. Enable access to user’s directory in HTTPd
    <IfModule mod_userdir.c>
        UserDir public_html
    </IfModule>
    
    <Directory /home/*/public_html>
        AllowOverride FileInfo AuthConfig Limit
        Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
        <Limit GET POST OPTIONS>
           Order allow,deny
            Allow from all
        </Limit>
        <LimitExcept GET POST OPTIONS>
            Order deny,allow
            Deny from all
        </LimitExcept>
    </Directory>
    
  6. Enable HTTPd password in Apache
    $ cat .htaccess
    AuthUserFile /home/adam/public_html/.htpasswd
    AuthType Basic
    AuthName "My Files"
    Require valid-user
    
    $ htpasswd -c .htpasswd username1
    
  7. List files with TimeStamp, PathName, Size (in bytes):
    find . -type f -printf "%TY/%Tm/%Td\t%TH:%TM:%TS\t%P
    
  8. VNC Server with GDM
  9. SELinux related commands
  10. Mounting Windows shares on Linux
  11. Connect to Databases using PHP
  12. Build Boost on Linux
  13. Accelerated Downloads on Linux
  14. Using GIT Version Control
  15. Join/Manipulate PDF Files
  16. Kill process tree
  17. Record Video on Linux
  18. Alpine with IMAP/GMAIL
  19. Basic MySQL Commands
  20. SSH Tunnel for Subversion
  21. Using screen on Linux
Advertisements

Written by curious

September 29, 2010 at 10:49 am

Posted in linux

%d bloggers like this: