Parsing JSON in Bash is never usually the best idea but sometimes it may be necessary or preferred. Here’s a nice easy script which uses the ‘jq’ command to perform JSON parsing in Bash.
Let’s imagine you have the following JSON which is outputted by a stats gathering process:
Parsing that in Bash by writing some regex’s etc is perfecting possible but there’s an infinitely easier way. Welcome to ‘jq’. Let’s see it in action.
I thought a wee article on what a server is and why they are expensive compared to your average PC might be interesting. When you hear someone say they have built a server for the house what they usually mean to say is they’ve built a PC and have it running various applications which serves ‘stuff’. A real server is a different beast all together.
So what makes a server a server? It boils down to the hardware feature set. Sure, you can get low-end servers which are nothing more than a PC in a fancy rack mount chassis, but lets take a look at higher end goodness.
This will be a quick tutorial on how to configure an Exit Node for the Tor Network. Doing this comes with some inherent risks for the operator but exit nodes are essential for bridging Tor with the ‘clear net’. Without exit nodes, anyone suffering from ISP filtering or those not wishing to have their Internet activity logged (BBC Article) couldn’t utilise Tor to access the Internet.
Unlike bridges, exit nodes (and normal relays) are publicly known devices, for which their IP address and configuration is available for anyone to see. They effectively make the final connection to the destination on behalf of the originating (anonymous) client. The Tor network is drastically short of exit nodes, but for good reason. Because they are the final hop in the chain, they will be making hundreds of outbound connections to whatever website or service Tor users request. It is therefore easy for the powers who be to blame an exit node operator for ‘doing bad things’ when in fact their node is merely participating in a network, much like a traditional router would in any network. Anyway, assuming you have balls of steel and willing to run an exit node I’ll take a look at how to do this with least hassle as possible.
Tor (‘The Onion Router’) is by far the most popular solution for anonymous browsing, with over 6000 relays and 2.5 million active users. I’m going to look at how to configure Tor on your network, in a variety of ways. The so called ‘Dark Web’ seems to get a bad press, maybe because of illegal sites like Silkroad, but it’s actually an invaluable resource for citizens or visitors to countries who have severe Internet censorship (including the UK!). Even Facebook has a .onion address, as does the DuckDuckGo search engine and Aphex Twin’s ‘Syro’ album.
By far the simplest and most secure way of using Tor is to install the Tor Browser. It’s dead simple and takes literally a few minutes. However, depending on your goal, there are other ways to use Tor. I’m going to look at a few ways to deploy Tor, including the pros and cons of each. These are:
- Using the Tor Browser Bundle
- Configuring a Tor SOCKS proxy
- Creating a transparent Tor network
As the UK government have announced they wish to classify Internet access as a public utility (implying it shouldn’t be a privilege but should be more like electricity etc) I thought I’d share how I have opened my Internet connection for anyone to use. As long as you can receive the signal you can connect and browse to your heart’s content without any keys or passwords.
Firstly, this is against the T&C’s of most ISPs, including mine. There’s a few (il)logical reasons for that but it’s mainly revenue protection. Even though they know a single connection would be perfectly suitable for many households to share, they would obviously lose money if everyone did that. Namely because, unlike other utilities, Internet access is generally not metered, meaning it’s a fixed cost per household per month. If your neighbour cannot afford their own Internet access or for whatever reason cannot get a contract then I feel it’s only fair to allow them to use mine. With talk of some people not being able to afford heating during the winter it’s hardly appropriate to expect them to also afford broadband. Who needs Internet access though? I mean it’s not like online shopping is generally cheaper or anything, not to mention almost everything is moving towards e-billing, right?
I’m not going to suggest everyone should just blindly open up their WiFi router for anyone to use but here’s how I’ve achieved this safely.
Sometimes you just have to know something exists before you look into it. IPv6 tunnels may well be a good example. Many ISPs are stuck in the dark ages, what with their archaic attitudes and red tape procedures longer than a trip to Mars.
It’s dead simple to get IPv6 working at home via an IPv6 tunnel broker.
I guess this is somewhat ironic, given their 90’s style logo and website, but these guys provide the tools you need to get your Internet connection this side of the new millennium. Guess what – it’s FREE!
If, like me, you use a Raspberry Pi as a multimedia centre it’s really handy being able to kick off a torrent without having to be logged into the Pi. This is especially useful if you want to download something using your phone, to your Pi, from literally anywhere.
Here’s how to configure Transmission so you can download torrents to your Pi from anywhere.
For a casual bit of weekend fun I thought I’d share a potential method for obtaining your neighbour’s Facebook password. This is purely educational and I used my own systems to do this but it highlights how potentially easy it can be to obtain someone’s login credentials to any website.
We are going to utilise various attack vectors to demonstrate the methodology of the process. The story starts with a hypothetical situation.
I upgraded to OS X El Capitan so I could be down with the kool kats and join the revolution. Not really – I installed it ‘cos it’s new and shiny. Although the upgrade went smooth enough (and only took an hour) I discovered several applications were now broken 🙁
I’ll save everyone from nonsensical rambling and get down to the facts. First up, prank calls…
With the ever greater need for the adoption of IPv6 in the Internet world it’s high time people started dual stacking services on both IP versions. Sadly, sometimes this is not possible when particular software hasn’t caught up with 1995.
This is especially frustrating when, for one reason or another, you want to use a single hostname for both services which support v6 and those which don’t.
The reason this is complicated is because a single hostname more »
After posting how great Tarsnap is I thought it only fair to write a ‘how to install Tarnsap on Linux’ article, so here goes.
Sign up for an account
This is the easiest part, simply create an account at Tarsnap.com and verify your e-mail address. You will need to ‘top up’ your account with at least 5 American Pasos to actually get started so may as well do that right away. I used Paypal as it makes me feel safe and when I feel safe I sleep better at night.
Once you have an account balance there’s actually not much else to do via the website; the rest is all command line goodness.
Download and Compile the Source Code
I’m going to do the rest as the ‘root’ user. If you’re not feeling as brave you may wish to prefix every command with ‘sudo’ as your normal user – for some reason Ubuntu et al seem to love doing this.
At the time of writing version 126.96.36.199 was the latest.
First up lets get root and change to /tmp and then download the tarball:
sudo -i cd /tmp/ wget https://www.tarsnap.com/download/tarsnap-autoconf-188.8.131.52.tgz