Ruben Ploneda

  • rss
  • archive
  • Add line numbers to everything!

    Use nl to add line numbers to every output of your commands. Useful for to explain a configuration file. Examples:

    $ nl httpd.conf
    

    or

    $ nl httpd.con | less
    
    • 2 months ago
    • #nl
    • #tricks
    • #linux
    • #tips
    0 Comments
  • 5 quick and dirty Linux tips you may not know

    1. Grep without the grep (don’t use grep -v to filter the process you’re running anymore)
    2. Kill them all
    3. Space hogs (this one is not really a trick but a must-know)
    4. Getting the magic back
    5. Screen your sessions (this one is priceless)

    • 2 months ago
    • #linux
    • #tricks
    • #tips
    • #links
    0 Comments
  • Scan ports without nmap

    Next time you’re on linux and don’t have nmap available, use this simple trick to scan ports:

    $ /dev/tmp/[IP]/[Port]
    

    A Connection refused message means the port is closed. No output means the port is open.

    Create a script that runs this from 1 to 65535 and have all the ports scanned on a specific IP.

    Remember the $ at the beginning is the shell prompt, no need to type it.

    • 2 months ago
    • 1 notes
    • #linux
    • #nmap
    • #scan
    • #ports
    • #networking
    1 Comments
  • Calculating Gateway and Subnet Mask

    This is a really simplified guide about calculating gateway and subnet mask from an IP and subnet, these are usually represented like this: 192.168.1.15/26

    I assume you already know binary and to perform logical operations (AND, OR, etc.), if you don’t you should learn that first.

    The first thing is to understand that the /26 gives us the subnet mask itself. And the second thing that we need to know is that an IP is composed by 32 bits, which can be divided in 4 octets. To calculate the subnet mask you need to write down the bits with 1 from left to right and fill out the rest with 0. An IP contains 32 bits.

    /26 = 26 bits = _11111111.11111111.11111111.11_000000 = 255.255.255.192 

    To calculate the gateway just perform and AND operation between the IP and the subnet mask.

                 IP = 192.168.1.15    = 11000000.10101000.00000001.00001111
    AND Subnet Mask = 255.255.255.192 = 11111111.11111111.11111111.11000000
             Result                   = 11000000.10101000.00000001.00000000
            Gateway = 192.168.1.0  

    This may look hard or not be clear at first. Keep practicing. It’s really useful if you want to be a SysAdmin.

    You could also use a subnet calculator too, but where is the fun in that?

    Had to make some edits. Looks like the Android app for tumblr doesn’t play well with Markdown. I’ll have to look for an alternative later.

    • 2 months ago
    • 4 notes
    • #sysadmin
    • #networking
    • #calculate
    • #subnet
    4 Comments
  • Hello World

    I’m trying to get back to writing. Now I’m doing this in english to improve my english ninja skills. In order to keep this simple, fast and cheap I’m using the following:

    • Pelican to generate static content
    • Octopress, now I’m using octopress. Is a lot easier to setup and write.
    • NearlyFreeSpeech.NET keep it cheap (see their pricing summary). If everything goes as expected this site should be up for a loooooong time.
    • VirtualBox to have my dev environment on my Windows machine but running linux on the host
    • Ubuntu Minimal to keep my VM lighting fast and boot it in 5 seconds :o)
    • Markdown to keep writing simple and be able to migrate whenever I want.(To give you an example I’ve made this site on Pelican, Octopress and now Tumblr with minimal editing)
    • And finally Tumblr, I found it easier to mantain and faster to publish, can follow others and it also supports Markdown.

    And that’s it. Eventually I’ll come here and write stuff I learn, and who knows, maybe I’ll write something in spanish just to honor my roots :)

    Adios!

    • 2 months ago
    • #links
    • #personal
    • #about
    0 Comments
© 2012–2013 Ruben Ploneda