Struggling with usb-creator then use….

I struggle for the best part of an evening trying to install ubuntu onto a usb stick. My first google searches results pointed towards usb-creator which from the outset looks good but continued to get various errors (Installation failed was the main annoying message).

Anyway, after googling various error messages I stumbled across this little beaut which saved the day, UNetbootin:

Why resizing a partition took 3 hours I’ll never know :(

Add additional IP address to and existing interface

Environment: Linux 2.6.32-220.23.1.el6.x86_64 #1

It is possible to assign more than one IP address to one physical interface.

Why would you want to do this? There may be several reasons for wanting additional IP addresses on one card, in my case I want to fire up an additional instance of Jboss but to do this I need to bind to a unique IP address. In linux (in this example its centos) its simple, follow these steps:

First run an ipconfig to see what you have configured:

 bash |  copy code |? 
  1. > ifconfig
  2. eth0      Link encap:Ethernet  HWaddr 00:50:56:87:00:1E  
  3.           inet addr:  Bcast:  Mask:
  4.           inet6 addr: fe80::250:56ff:fe87:1e/64 Scope:Link
  5.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  6.           RX packets:186158343 errors:0 dropped:0 overruns:0 frame:0
  7.           TX packets:586031577 errors:0 dropped:0 overruns:0 carrier:0
  8.           collisions:0 txqueuelen:1000
  9.           RX bytes:41119255272 (38.2 GiB)  TX bytes:814282374844 (758.3 GiB)

You can this interface is assigned the IP address of, next we need to edit a file so cd to /etc/sysconfig/network-scripts (this may be slightly different depending on your flavour of linux).

 bash |  copy code |? 
  1. > cd /etc/sysconfig/network-scripts

In this folder you will find the config files for the interfaces, we are interested in the interface eth0 so we need to create a new file called ifcfg-eth0:1 (or ifcfg-eth0\:1) and add the following:

 bash |  copy code |? 
  1. DEVICE=eth0:1
  3. ONBOOT=yes
  4. HWADDR=00:50:56:87:00:1e
  5. TYPE=Ethernet
  6. BOOTPROTO=none
  7. IPADDR=
  8. PREFIX=24
  10. DNS1=
  11. DEFROUTE=yes
  13. IPV6INIT=no
  14. NAME="System eth0:1"
  15. DNS2=
  16. USERCTL=no

Notice the hardware address is the same as eth0 interface but the IP address is not, this IP address will be our new IP address but uses the same interface…

To enable the new IP address bring it up with ifup and the run an ifconfig to see the new settings, hopefully will look something like this:

 bash |  copy code |? 
  1. > ifup eth0:1
  2. > ifconfig
  3. eth0      Link encap:Ethernet  HWaddr 00:50:56:87:00:1E  
  4.           inet addr:  Bcast:  Mask:
  5.           inet6 addr: fe80::250:56ff:fe87:1e/64 Scope:Link
  6.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  7.           RX packets:186162124 errors:0 dropped:0 overruns:0 frame:0
  8.           TX packets:586035365 errors:0 dropped:0 overruns:0 carrier:0
  9.           collisions:0 txqueuelen:1000
  10.           RX bytes:41119647929 (38.2 GiB)  TX bytes:814285419799 (758.3 GiB)
  11. eth0:1    Link encap:Ethernet  HWaddr 00:50:56:87:00:1E  
  12.           inet addr:  Bcast:  Mask:
  13.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

Proxy says yes!

There’s nothing more annoying than sitting behind your works proxy and being denied access to your favorite blogging/social websites so here’s a way round it…. Most companies would frown on this kind of activity – tread carefully, you have been warned!!

What you need:

  • A linux server sat at home connected to the net running ssh, change the default port from 22 to 443 (https port)
  • You’ll need the ip address for this machine too

Let’s begin… On your restricted machine install proxychains, (debian based: sudo apt-get install proxychainsrpm based: yum install proxychains), we use proxy chains to channel our command line apps through the internal proxy. Once installed you’ll need to edit the config file which is located (on my machine anyway) @ /etc/proxychains.conf, there’s a couple of minor changes you need to make and an addition, I’ve removed a lot of the commented out options and added my proxy details to the bottom of the script too:

 bash |  copy code |? 
  1. #<!--DVFMTSC--> proxychains.conf<!--DVFMTSC--> <!--DVFMTSC--> VER<!--DVFMTSC--> 3.1
  2. #
  3. #<!--DVFMTSC--> <!--DVFMTSC--> <!--DVFMTSC--> <!--DVFMTSC--> <!--DVFMTSC--> <!--DVFMTSC--> <!--DVFMTSC--> <!--DVFMTSC--> HTTP,<!--DVFMTSC--> SOCKS4,<!--DVFMTSC--> SOCKS5<!--DVFMTSC--> tunneling<!--DVFMTSC--> proxifier<!--DVFMTSC--> with<!--DVFMTSC--> DNS.
  4. #
  5. #<!--DVFMTSC--> The<!--DVFMTSC--> option<!--DVFMTSC--> below<!--DVFMTSC--> identifies<!--DVFMTSC--> how<!--DVFMTSC--> the<!--DVFMTSC--> ProxyList<!--DVFMTSC--> is<!--DVFMTSC--> treated.
  6. #<!--DVFMTSC--> only<!--DVFMTSC--> one<!--DVFMTSC--> option<!--DVFMTSC--> should<!--DVFMTSC--> be<!--DVFMTSC--> uncommented<!--DVFMTSC--> at<!--DVFMTSC--> time,
  7. #<!--DVFMTSC--> otherwise<!--DVFMTSC--> the<!--DVFMTSC--> last<!--DVFMTSC--> appearing<!--DVFMTSC--> option<!--DVFMTSC--> will<!--DVFMTSC--> be<!--DVFMTSC--> accepted
  8. #
  9. strict_chain
  10. #
  11. #<!--DVFMTSC--> Strict<!--DVFMTSC--> <!--DVFMTSC-->−<!--DVFMTSC--> Each<!--DVFMTSC--> connection<!--DVFMTSC--> will<!--DVFMTSC--> be<!--DVFMTSC--> done<!--DVFMTSC--> via<!--DVFMTSC--> chained<!--DVFMTSC--> proxies
  12. #<!--DVFMTSC--> all<!--DVFMTSC--> proxies<!--DVFMTSC--> chained<!--DVFMTSC--> in<!--DVFMTSC--> the<!--DVFMTSC--> order<!--DVFMTSC--> as<!--DVFMTSC--> they<!--DVFMTSC--> appear<!--DVFMTSC--> in<!--DVFMTSC--> the<!--DVFMTSC--> list
  13. #<!--DVFMTSC--> all<!--DVFMTSC--> proxies<!--DVFMTSC--> must<!--DVFMTSC--> be<!--DVFMTSC--> online<!--DVFMTSC--> to<!--DVFMTSC--> play<!--DVFMTSC--> in<!--DVFMTSC--> chain
  14. #<!--DVFMTSC--> otherwise<!--DVFMTSC--> EINTR<!--DVFMTSC--> is<!--DVFMTSC--> returned<!--DVFMTSC--> to<!--DVFMTSC--> the<!--DVFMTSC--> app
  15. #
  16. #<!--DVFMTSC--> Quiet<!--DVFMTSC--> mode<!--DVFMTSC--> (no<!--DVFMTSC--> output<!--DVFMTSC--> from<!--DVFMTSC--> library)
  17. #quiet_mode
  18. #<!--DVFMTSC--> Proxy<!--DVFMTSC--> DNS<!--DVFMTSC--> requests<!--DVFMTSC--> <!--DVFMTSC-->−<!--DVFMTSC--> no<!--DVFMTSC--> leak<!--DVFMTSC--> for<!--DVFMTSC--> DNS<!--DVFMTSC--> data
  19. #proxy_dns<!--DVFMTSC--> 
  20. #<!--DVFMTSC--> Some<!--DVFMTSC--> timeouts<!--DVFMTSC--> in<!--DVFMTSC--> milliseconds
  21. tcp_read_time_out<!--DVFMTSC--> 15000
  22. tcp_connect_time_out<!--DVFMTSC--> 8000
  23. [ProxyList]
  24. http<!--DVFMTSC--> <!--DVFMTSC--> <!--DVFMTSC--> <!--DVFMTSC--> <proxy<!--DVFMTSC-->−ip<!--DVFMTSC-->−here><!--DVFMTSC--> <!--DVFMTSC--> <!--DVFMTSC--> <!--DVFMTSC--> <!--DVFMTSC--> 80<!--DVFMTSC--> <!--DVFMTSC--> <!--DVFMTSC--> <!--DVFMTSC--> <!--DVFMTSC--> <!--DVFMTSC--> Proxy<!--DVFMTSC-->−User<!--DVFMTSC--> Proxy<!--DVFMTSC-->−Password

Once this is in place you should now be able to ssh to your linux box from behind the proxy:

 bash |  copy code |? 
  1. proxychains<!--DVFMTSC--> ssh<!--DVFMTSC--> <!--DVFMTSC-->−p<!--DVFMTSC--> 443<!--DVFMTSC--> username@home<!--DVFMTSC-->−machine<!--DVFMTSC-->−ip

You’ll see something like the following if proxychains is working correctly:

|S-chain|-<>-<><>-<><>-OK’s password:

So what is going on in the line above? We’re asking our local machine to ssh to the home machine on port 443. Why port 443? Well from my works pc every single external port is blocked, if I want to access anything externally I need to direct traffic through the proxy which has 2 ports open (80 for http access & 443 for https access). We’re also preceding the ssh command with the proxychains command, this directs the traffic via the internal proxy!

So that’s great, you can now ssh to your home linux box which you we’rent allowed to before! Superb, so what can we do with this?

Well to start with you can fire up a browser over your ssh connection using the -X flag on the ssh command:

 bash |  copy code |? 
  1. proxychains<!--DVFMTSC--> ssh<!--DVFMTSC--> <!--DVFMTSC-->−p<!--DVFMTSC--> 443<!--DVFMTSC--> <!--DVFMTSC-->−X<!--DVFMTSC--> username@home<!--DVFMTSC-->−machine<!--DVFMTSC-->−ip

Once connected to your linux box you can then fire up your browser (user@~$ firefox) and start surfing as if you were sat at your home machine (ie no restrictions!!), now I’m excited! It’s probably at that point you will want to jump up and share your ability to access you’re favorite sites with your colleagues – but please refrain from doing this as I’ve mentioned before it’s likely to be frowned upon so the longer you can keep this secret the better!!