Tagged: linux Toggle Comment Threads | Keyboard Shortcuts

  • harlekwinblog 3:08 pm on September 29, 2011 Permalink | Reply
    Tags: , linux   

    Switching betwen two directories in Bash 

    The pushd command remembers the last pushd’ed from directory
    #cd /
    #pushd /home
    #pwd
    /home
    #pushd
    #pwd
    /

    But quicker is “~-” which will simply take you back to the last working directory
    #cd /
    #cd /home
    #pwd
    /home
    #cd ~-
    #pwd
    /

     
  • harlekwinblog 8:19 am on September 6, 2011 Permalink | Reply
    Tags: linux, , osx,   

    Flushing DNS:

    • Windows: ipconfig /flushdns
    • Linux: service nscd restart
    • Mac OS X: dscacheutil -flushcache
     
  • harlekwinblog 10:49 am on August 18, 2011 Permalink | Reply
    Tags: linux   

    Is Linux 32b or 64b?
    uname -m

    • 32b
      i386
      i686

    • 64b
      x86_64
     
  • harlekwinblog 2:07 pm on August 2, 2011 Permalink | Reply
    Tags: , linux,   

    giving permission to read a specific file using sudo:
    visudo
        #Support Staff
        Cmnd_Alias = LOGS = /bin/cat /var/log/squid/access.log, /bin/zcat /var/log/squid/access.log.[0-9].gz
        %logaccess ALL (all) NOPASSWD: LOGS

    This gives access to the Squid Logs to anyone in the logaccess group.
    (sudo zcat /var/log/squid/access.log.1.gz) | grep "microsoft.com"

    Advertisement
     
  • harlekwinblog 2:55 pm on June 16, 2011 Permalink | Reply
    Tags: linux, ,   

    Proxy.Pac files can be tricky. The way to identify the client is:
    myIPAddress()
    But this fails occassionally, reporting the LocalHost address instead, especially in Linux.
    Additionally, on Windows 7 multiple enabled interfaces can lead to the wrong one reporting back.
    There is no fix but DISABLING the inappropriate interfaces and re-enabling them can work.

     
  • harlekwinblog 12:27 pm on May 17, 2011 Permalink | Reply
    Tags: Awk, linux   

    In awk you can run a command using variables from awk by saving the command to a variable first, then get line can be used to retrieve the result.
    /condition/ {
        myVariable = "some value"
        CMDFILE = "echo "myVariable" | head"
        CMDFILE | getline myAnswer
        close(CMDFILE)
        print myAnswer
    }

    don’t forget the close statement!!,.

     
  • harlekwinblog 3:36 pm on March 30, 2011 Permalink | Reply
    Tags: file descriptors, linux, proxy, Redhat, resources   

    Squid by default on RedHat only uses a maximum number of file descriptors of a meagre 1024.
    To increase this:

    • Add lines in the /etc/security/limits.conf file:
      squid soft nofile 20480
      squid hard nofile 20480

    • Add line in the /etc/squid/squid.conf file:
      max_filedesc 20480

    • Add line in the /etc/init.d/squid file:
      ulimit -HSn 20480

    • Restart the squid service:
      service squid restart

    This will DEFAULT to the COMPILED setting of 16k file descriptors rather than our selected value of 20K.

     
  • harlekwinblog 4:51 pm on February 28, 2011 Permalink | Reply
    Tags: , e-mail, linux, mutt   

    Using the file ~/.muttrc you can set the FROM address in outbound messages from the root user to an arbitrary but more appropriate value:
    vim ~/.muttrc
    Add the lines:

    set from=noreply@my.domain
    set envelope_from=yes
    set realname=NoReply

    Or as you see fit – Envelope Sender is also controlled with this setting

     
  • harlekwinblog 3:06 pm on February 21, 2011 Permalink | Reply
    Tags: , linux, screen   

    To share the same interface when on a Linux server you can use screen
    To start a session:
    screen -S {session-name}
    To join a session:
    screen -x {session-name}
    Both administrators will then be able to type commands fully visible to each other.

     
  • harlekwinblog 2:24 pm on February 21, 2011 Permalink | Reply
    Tags: linux, , tcpdump   

    When using TCPDUMP you can use -s 0 to not limit the size of the packets retrieved by the -w {Filename} option.

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel