UrFix's Blog

A geek without a cause

  • Facebook Profile Picture Hack Tutorial In Linux With GIMP

    by

    There are a lot of changes in Facebook lately, small and large which you can read about in great detail at TechCrunch.

    Here are a few:

    • A stream of your recent tagged photos appears at the top of the screen, and there are more pictures of your friends on the page. This is because the main problem with Facebook is that there weren’t enough opportunities to see pictures of people.
    • Now there’s a field on your page called “philosophy,” which folds in your religious, political views and favorite quote. Plus a brand new field: “People Who Inspire You.” (If you put Mark Zuckerberg you should be able to get access to a special Super Facebook.)
    • All your vital stats are squished up under your name in a list now. It actually looks pretty good, like you’re a character in a Role Playing Game or something!
    • There is also a field for sports, if you can somehow fit physical activity in between checking your Facebook profile
    • Tabs bring up different sections of your profile. Tabs: So hot right now.

    I’m going to show you how to create the “Famous New Profile Hack” using GIMP

    Let’s begin

    Start by picking the picture you would like to use.

    Take a screen-shot of your Facebook profile

    open your new profile screen-shot inside of GIMP

    Paste the first picture you chose to use in step one as a new layer

    Now grab the GIMP side ruler and drag two guide 200 width and 600 height

    now grab the select tool and copy in between the new guides

    and select Edit-> Paste as new image.

    save that new image as profile.jpg

    now create a guide for each small picture in the profile

    zoom in if you have to.

    I decreased the opacity of the original picture just to see if it will align properly

    Now with the select tool grab the first box

    copy

    and paste it as new image

    copy each box and paste as new image for the rest of the boxes.

    Now we should have 5 small pictures and the long profile picture

    Go to Facebook, Create a album and make sure “EVERYONE” is selected

    Upload the picture labeled profile.jpg and make this your profile picture

    We are almost done

    now start tagging your photos

    start from last to first

    Select the last pic and tag as yourself


    hit previous and tag the next one and so forth



    You are done. Wasn’t that easy

  • Step Up As A Developer To Help Support Linux On Ps3

    by

    PS3 CD builds stopped for Natty

    Official Statement

    Of course, Sony offered the option to not update your PS3 console if you still wanted to have a Linux operating system installed on it (or to back up your data from the Linux partition), but, on the other hand, you will no longer have access to various important features, such as signing into the PlayStation Network!

    http://news.softpedia.com/news/It-s-Official-Sony-Doesn-t-Support-Linux-Anymore-139051.shtml

    http://blog.us.playstation.com/2010/03/28/ps3-firmware-v3-21-update/

    The new update release notes said very clear that it would remove the “Other OS” function!

    If you have a good reason why we should keep building PS3 CD images for
    Natty, and are willing to step up as a developer to help support them,
    then please reply to ubuntu-devel at lists.ubuntu.com.
    
    
  • 25 Even More – Sick Linux Commands

    by

    I know how much you guys love top Linux commands. Lets consider this list a part two of my 25 More – Sick Linux Commands

    Be sure to check out commandlinefu for more awesome gems.

    1) Monitor progress of a command

    pv access.log | gzip > access.log.gz

    Pipe viewer is a terminal-based tool for monitoring the progress of data through a pipeline. It can be inserted into any normal pipeline between two processes to give a visual indication of how quickly data is passing through, how long it has taken, how near to completion it is, and an estimate of how long it will be until completion. Source: http://www.catonmat.net/blog/unix-utilities-pipe-viewer/

    2) Graphical tree of sub-directories

    ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'
    

    Prints a graphical directory tree from your current directory

    3) Delete all files in a folder that don’t match a certain file extension

    rm !(*.foo|*.bar|*.baz)
    

    Deletes all files in a folder that are NOT *.foo, *.bar or *.baz files. Edit the pattern inside the brackets as you like.

    4) Easy and fast access to often executed commands that are very long and complex.

    
    some_very_long_and_complex_command # label
    

    When using reverse-i-search you have to type some part of the command that you want to retrieve. However, if the command is very complex it might be difficult to recall the parts that will uniquely identify this command. Using the above trick it’s possible to label your commands and access them easily by pressing ^R and typing the label (should be short and descriptive).

    5) Define a quick calculator function

    ? () { echo "$*" | bc -l; }
    

    defines a handy function for quick calculations from cli.

    once defined:

    ? 10*2+3

    6) Display a cool clock on your terminal

    watch -t -n1 "date +%T|figlet"
    

    This command displays a clock on your terminal which updates the time every second. Press Ctrl-C to exit.

    A couple of variants:

    A little bit bigger text:

    watch -t -n1 "date +%T|figlet -f big"You can try other figlet fonts, too.

    Big sideways characters:

    watch -n 1 -t '/usr/games/banner -w 30 $(date +%M:%S)'This requires a particular version of banner and a 40-line terminal or you can adjust the width (“30” here).

    7) intercept stdout/stderr of another process

    strace -ff -e trace=write -e write=1,2 -p SOME_PID
    

    8) Remove duplicate entries in a file without sorting.

    awk '!x[$0]++' <file>
    

    Using awk, find duplicates in a file without sorting, which reorders the contents. awk will not reorder them, and still find and remove duplicates which you can then redirect into another file.

    9) Record a screencast and convert it to an mpeg

    ffmpeg -f x11grab -r 25 -s 800x600 -i :0.0 /tmp/outputFile.mpg
    

    Grab X11 input and create an MPEG at 25 fps with the resolution 800×600

    10) Mount a .iso file in UNIX/Linux

    mount /path/to/file.iso /mnt/cdrom -oloop
    

    “-o loop” lets you use a file as a block device

    11) Insert the last command without the last argument (bash)

    !:-
    

    /usr/sbin/ab2 -f TLS1 -S -n 1000 -c 100 -t 2 http://www.google.com/then

    !:- http://www.urfix.com/is the same as

    /usr/sbin/ab2 -f TLS1 -S -n 1000 -c 100 -t 2 http://www.urfix.com/

    12) Convert seconds to human-readable format

    date -d@1234567890
    

    This example, for example, produces the output, “Fri Feb 13 15:26:30 EST 2009”

    13) Job Control

    ^Z $bg $disown
    

    You’re running a script, command, whatever.. You don’t expect it to take long, now 5pm has rolled around and you’re ready to go home… Wait, it’s still running… You forgot to nohup it before running it… Suspend it, send it to the background, then disown it… The ouput wont go anywhere, but at least the command will still run…

    14) Edit a file on a remote host using vim

    vim scp://username@host//path/to/somefile
    

    15) Monitor the queries being run by MySQL

    watch -n 1 mysqladmin --user=<user> --password=<password> processlist
    

    Watch is a very useful command for periodically running another command – in this using mysqladmin to display the processlist. This is useful for monitoring which queries are causing your server to clog up.

    More info here: http://codeinthehole.com/archives/2-Monitoring-MySQL-processes.html

    16) escape any command aliases

    \[command]
    

    e.g. if rm is aliased for ‘rm -i’, you can escape the alias by prepending a backslash:

    rm [file] # WILL prompt for confirmation per the alias

    \rm [file] # will NOT prompt for confirmation per the default behavior of the command

    17) Show apps that use internet connection at the moment. (Multi-Language)

    ss -p
    

    for one line per process:

    ss -p | catfor established sockets only:

    ss -p | grep STAfor just process names:

    ss -p | cut -f2 -sd\"or

    ss -p | grep STA | cut -f2 -d\"

    18) Send pop-up notifications on Gnome

    notify-send ["<title>"] "<body>"
    

    The title is optional.

    Options:

    -t: expire time in milliseconds.

    -u: urgency (low, normal, critical).

    -i: icon path.

    On Debian-based systems you may need to install the ‘libnotify-bin’ package.

    Useful to advise when a wget download or a simulation ends. Example:

    wget URL ; notify-send "Done"

    19) quickly rename a file

    mv filename.{old,new}
    

    20) Remove all but one specific file

    rm -f !(survivior.txt)
    

    21) Generate a random password 30 characters long

    strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 30 | tr -d '\n'; echo
    

    Find random strings within /dev/urandom. Using grep filter to just Alphanumeric characters, and then print the first 30 and remove all the line feeds.

    22) Run a command only when load average is below a certain threshold

    echo "rm -rf /unwanted-but-large/folder" | batch
    

    Good for one off jobs that you want to run at a quiet time. The default threshold is a load average of 0.8 but this can be set using atrun.

    23) Binary Clock

    watch -n 1 'echo "obase=2;`date +%s`" | bc'
    

    Create a binary clock.

    24) Processor / memory bandwidthd? in GB/s

    dd if=/dev/zero of=/dev/null bs=1M count=32768
    

    Read 32GB zero’s and throw them away.

    How fast is your system?

    25) Backup all MySQL Databases to individual files

    for I in $(mysql -e 'show databases' -s --skip-column-names); do mysqldump $I | gzip > "$I.sql.gz"; done
    
    

    That’s all for today and I hope you enjoyed this list.

  • 9 Ways To Take a Huge Tcpdump

    by

    tcpdump is a common packet analyzer that runs under the command line. It allows the user to intercept and display TCP/IP and other packets being transmitted or received over a network to which the computer is attached.

    Man Page

    Also check out these cool tcpdump usage examples here

    1) analyze traffic remotely over ssh w/ wireshark

    ssh root@example.com tcpdump -w - 'port !22' | wireshark -k -i -

    This captures traffic on a remote machine with tcpdump, sends the raw pcap data over the ssh link, and displays it in wireshark. Hitting ctrl+C will stop the capture and unfortunately close your wireshark window.

    2) Get Cisco network information

    tcpdump -nn -v -i eth0 -s 1500 -c 1 ‘ether[20:2] == 0x2000’

    This gives you lots of nifty Cisco network information like VLAN tag, port and switch information.

    3) Remotely sniff traffic and pass to snort

    ssh root@pyramid \ “tcpdump -nn -i eth1 -w -” | snort -c /etc/snort/snort.conf -r –

    I have a small embedded linux device that I wanted to use for sniffing my external network, but I didn’t want to recompile/cross-compile snort for the embedded platform. So I used tcpdump over ssh to pass all the traffic as pcap data to a “normal” Linux system that then takes the pcap data and passes it to snort for processing.

    4) Sniffing network (gui)

    tcpdump -v -i <INTERFACE> -s 0 -w /tmp/sniff.pcap port <PORT> # On the remote side

    Then hit ^C to stop, get the file by scp, and you can now use wireshark like this :

    wireshark /tmp/sniff.pcap

    If you have tshark on remote host, you could use that :

    wireshark -k -i <(ssh -l root <REMOTE HOST> tshark -w - not tcp port 22)

    The last snippet comes from http://wiki.wireshark.org/CaptureSetup/Pipes

    5) Getting started with tcpdump

    tcpdump -nli eth0; tcpdump -nli eth0 src or dst w.x.y.z;

    tcpdump -nli eth0 port 80; tcpdump -nli eth0 proto udp

    At some point you want to know what packets are flowing on your network. Use tcpdump for this. The man page is obtuse, to say the least, so here are some simple commands to get you started.

    -n means show IP numbers and don’t try to translate them to names.

    -l means write a line as soon as it is ready.

    -i eth0 means trace the packets flowing through the first ethernet interface.

    src or dst w.x.y.z traces only packets going to or from IP address w.x.y.z.

    port 80 traces only packets for HTTP.

    proto udp traces only packets for UDP protocol.

    Once you are happy with each option combine them with ‘and’ ‘or’ ‘not’ to get the effects you want.

    6) Capture data in ASCII. 1500 bytes

    tcpdump -i eth0 -n tcp port 80 -A -s1500

    Sniffing traffic on port 80 only the first 1500 bytes

    7) See entire packet payload using tcpdump.

    tcpdump -nnvvXSs 1514 -i <device> <filters>

    This command will show you the entire payload of a packet.

    The final “s” increases the snaplength, grabbing the whole packet.

    8) view http traffic

    tcpdump -i eth0 port 80 -w - | hd

    9) ignore all ssh traffic

    tcpdump -i eth0 -n 'port ! 22'

    and That’s how you take a Tcpdump ;)

Chat

Hi 👋, how can we help?