Finding large files in a directory

I have directories that agedu shows as having large files. However, agedu doesn’t tell me what the names of the files are. A quick find will sort that find . -maxdepth 1 -type f -exec \/usr\/bin\/ls -al {} \; | awk '{print $5,$9}' | sort -nr > bigfiles.txt Run this, and you will have a file called bigfiles.txt that has the size in bytes and the filename. This does not work recursively, with the flag -maxdepth 1 preventing that.
Read more...

How to download newspapers with Calibre and deliver to your Kindle

So, I have read a few pages which outline how to do this, but none seem to sum all of it. I’ve set up my Raspberry to download a newspaper and then deliver it daily to my Kindle. I paid for a subscription (in fact, I pay for more than one subscription) so I feel entitled to do this, as I’m supporting the journalists financially. Firstly, you will need to install Calibre.
Read more...

Cuba

Trip to Cuba Having gone to one of the best destinations I’ve probably ever been to, I felt the need to document it in a more formal way. I was inspired by the Cuban culture and vibrant life to record some of the sights I’d seen. I like the achitecture of buildings. Once they were part of the finery of Havana, but since then, people don’t have the money to upkeep this kind of large building, hence its appearance.
Read more...

Trying a climb

This afternoon, I met up with a few friends at a local pub. It was great catching up with everyone, but what also great was that afterwards, I planned to cycle some 15km to one of the largest hills around. I wanted to see what it was like to climb roughly 150m up a hill. And find out, I did. I didn’t quite make it all the way to the top without stopping, but I got to the top with one break just near the top.
Read more...

Using sed

sed is a quick command line utility to change text within a file, or input stream. Typically, it is used within a pipe situation (i.e. using the character | on the command line). If you are not familiar with that command, you will need to research that before continuing. A simple use of sed is to replace characters in a stream or file. This is done using regular expressions. This will help you search for a set of characters and then replace them with the alternative.
Read more...

Bash find command

Find command I’ve been using the find command simply since I can remember, but I’ve never really got to see the true power of this command. Combined with the -exec flag this command can throw up a lot of different uses. -exec allows you to work with other bash commands and operate on them. A basic use would look like this: $ find . -name "*" -type f -size +10M -exec rm {} \; Let’s break this down.
Read more...

Setting up a firewall on Linux Ubuntu 14.04

Uses Firewalls allow only particular access to particular network ports and paths. You can remove access to a port or a specific IP address or a range of IP addresses. Admins can apply rules according to what access they would like - these rules include both outgoing and incoming network traffic. This allows admins to build barriers of trust across machines. Modern firewalls are based on Application Layer Firewalls and are aware of the kinds of applications and protocols that the connection is using.
Read more...

How to enable disk quotas for users

Uses Linux allows setting quotas on a filesystem. This will prevent users from using more diskspace than they are allowed. This can also be used to manage group allowances to enforce the allowance for a collection of users. Stopping users from filling up a diskspace can be an important on a shared system as filling up a physical disk drive can bring a system down, or make it unstable.
Read more...

Encrypt a partition on Linux

Introduction An encrypted partition can add a layer of security to your system. When initialized, it will ask for the passphrase which, if unavailable, will not allow proper mounting. This renders the information on the drive as unreadable. Most systems use the Linux Unified Key Setup (LUKS for short) format for encryption and this can be a standard install for most distribution. Steps for setting up LUKS Setting up the drive Firstly you should have a partition drive that is unmounted and unformatted (no filesystem).
Read more...