Quick Tips

You are currently browsing the archive for the Quick Tips category.

I have only tested this script on OS X 10.6.8, meaning: I have no idea if it works in other versions of OS X. For the most part, it should work without any issues – or worst case scenario: with minor modifications to this script.

This script automates the following process:

1. Identify current MAC Address
2. Generate a random MAC Address (for spoofing/changing)
3. Disconnect/Disassociate Interface
4. Change existing MAC Address with randomly generated MAC Address
5. Power up device/interface

Be sure to change the INTERFACE variable to suit your needs.

Here it is:

#!/bin/bash

# Change your network inteface ID here network interface here
INTERFACE=en1

ORIGINAL_MAC=`ifconfig $INTERFACE | grep ether | cut -d' ' -f2`

MAC=`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`

echo "Intial status:"
sudo ifconfig $INTERFACE

DISCONNECT_NETWORK="sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -z"

echo "Disconnect from current network"
eval $DISCONNECT_NETWORK
sleep 2

echo "Changing interface mac"
sudo ifconfig $INTERFACE lladdr $MAC
sleep 2

echo "Shutting down interface: $INTERFACE"
sudo ifconfig $INTERFACE down
sleep 2

echo "Starting up interface: $INTERFACE"
sudo ifconfig $INTERFACE up
sleep 2

echo "MAC changed from: $ORIGINAL_MAC to: $MAC"
echo "Retrieving new network status:"
sleep 10
ifconfig $INTERFACE

Having trouble?

If the above method does not work for any reason, try the following:

sudo airport -z
sudo ifconfig en1 ether c9:b2:5e:85:b2:dd
sudo ifconfig en1 ether

*change c9:b2:5e:85:b2:dd to anything you want

If you have a different version of OS X and have successfully ran a modified version of this script, please let me know.

Thanks.

 

So, you want to backup your entire Tumblr blog into a neat, browsable local HTML archive huh?

Before I show you how, a quick note:

I tried the official Mac OS X tumblr backup tool without much luck. It refused to accept my login credentials and kept giving me an error message (Sorry. Please Try Again). This backup tool was originally posted on the Tumblr Staff Blog (At the time of this writing, you cannot download the file. The link is broken. Dear tumblr, what the fuck?) You can find a copy over at Softpedia though.

2/3/2014 Update per Frostbox staff comment below: Frostbox also offers tumblr blog backups with the ability to download archives. It’s still not a free solution however.

I am going to assume that none of the above solutions worked for you. Let’s get started.

You will need:

1.) A unix working environment (note: you CAN run this under windows, but I won’t cover that today)

2.) Basic shell/bash/linux knowledge

3.) A tumblr blog

4.) Two python scripts: tumblr_backup.py & xmltramp.py

(Credit goes to Brenden and Beat for these two wonderful scripts. I am hosting the scripts above for redundancy and/or in case other links are broken. You should always get them from the original source (tumblr_backup.py & xmltramp.py) for the most up to date copies.)

Steps:

First, after saving those two scripts into your working directory, let’s make them executable by issuing:

chmod +x *.py

Then, we will make a full, HTML backup of your Tumblr blog by issuing:

(note: replace YOURBLOGNAME. For example, if your Tumblr blog is: cute-cats.tumblr.com, simply enter the first segment of your blog URL: cute-cats as the last argument)

python tumblr_backup.py -x YOURBLOGNAME

That’s it. This will create a folder called YOURBLOGNAME which will include a HTML archive of your entire blog. Once the process is done, you can simply open up the index.html file and browse it offline.

Troubleshooting & Notes:

You can also do incremental backups of your blog. Meaning, you won’t have to re-download the entire blog each time you make a backup. For incremental backups, simply use:

python tumblr_backup.py -x -i YOURBLOGNAME

To get a comprehensive list of all the possible options, simply issue:

$python tumblr_backup.py --help

Usage: tumblr_backup.py [options] blog-name ...

Makes a local backup of Tumblr blogs.

Options:
  -h, --help            show this help message and exit
  -q, --quiet           suppress progress messages
  -i, --incremental     incremental backup mode
  -x, --xml             save the original XML source
  -b, --blosxom         save the posts in blosxom format
  -r, --reverse-month   reverse the post order in the monthly archives
  -R, --reverse-index   reverse the index file order
  -a HOUR, --auto=HOUR  do a full backup at HOUR hours, otherwise do an
                        incremental backup (useful for cron jobs)
  -n COUNT, --count=COUNT
                        save only COUNT posts
  -s SKIP, --skip=SKIP  skip the first SKIP posts
  -p PERIOD, --period=PERIOD
                        limit the backup to PERIOD ('y', 'm', 'd' or
                        YYYY[MM[DD]])
  -P PASSWORD, --private=PASSWORD
                        password for a private tumblr

These scripts give us a lot of flexibility and can be easily integrated into your existing backup solution(s)/cron job(s). One last note — I have tested this solution on my tumblr blog successfully, but it’s important to mention that my blog contains mostly text. This script is designed to backup any Tumblr blog containing any media except video

Enjoy.

« Older entries