January 2011 Archive

Downloading HTTP in off-peak

January 24th, 2011

I want to write a quick and dirty blog post to tell you a little solution on downloading HTTP files in your off-peak usage using linux.

The tools I’ll be using for this is my old favourite wget and a new tool, “at”.

The at daemon is required to be running first, so on debian or ubuntu

/etc/init.d/atd start

Then downloading your file at an off-peak time (4am for me) is as simple as

echo “wget –c http://ubuntu.virginmedia.com/releases//maverick/ubuntu-10.10-desktop-i386.iso” | at 04:00

Simple hey Smile

PDF Automator in OSX

January 16th, 2011

As you may have been aware from my previous blog posts, I’ve been trying to make my life digital, that means any papers I get, I scan and file on a FileServer (with remote backups, etc, etc).

My scanner at home has a document feeder on it. The problem is that it doesn’t do duplex, only a set of sides. So far, I can scan one side of the document, flip the paper of, then scan the back pages. This will result two PDF’s with two sets of pages
Set A: 1,3,5,7
SET B: 8,6,4,2

To merge the two, I could open them both up in Adobe PDF, Preview and start clicking and dragging my time away, but that’s pointless. I’d like to introduce you to Automator in OSX.

Using a pdftk binary for OSX and the automator script above, all I need to do now is select my two pdf documents (Set A & B), right hand click, then select ‘Duplex Merge PDF’s’. After that, I’ll have a nice merged.pdf file on my desktop that’s the resulting page.

(the shell script uses pdftk to make a /tmp/2.pdf file that’s a set 2,4,6,8. Copies the Set A to /tmp/1.pdf and then pipes it through some pdf tools built into OSX to merge the sets into 1,2,3,4.. etc

Who needs to spend lots of money on a duplex scanner hey?

EDIT:
Please feel free to download my automator scripts here 

 

Apple feeling slow?

January 12th, 2011

Is your Apple Mac feeling slow?

p.s. this is a joke, don’t actually do it


Symfony not sortable in CRUD

January 1st, 2011

I’ve recently come up across some problems with the CRUD generator in Symfony, so in case anyone is googling for a solution out there, I’ll try and help you along (or at least bump up the page references to the articles that helped me ;) )

I had a problem today where I was trying to use Symfony’s (1.4) generate-admin CRUD generator. The issue was that my titles were not sortable when adjusting the fields to display in the generator.yml file

config:
actions: ~
fields: ~
list:
batch_actions: {}
object_actions: {}
display: [pin, firstName, lastName, location, institution]
filter:
display: [firstName, lastName]
form: ~
edit: {}
new: {}

The issue with the firstName and lastName fields is that, if written like first_name and last_name it will fail to become sortable. I found a solution as to why in a blog post from a man with the same issue (Symfony 1.2)

Foreign keys not Sortable:
Another issue I had was where there is a foreign key in Symfony, the CRUD generator won’t know how to make this sortable. I solved this by moving to ahAdminGeneratorThemesPlugin for the generate-admin modules.. Read the read-me in that guide and you’ll be sweet! :)

Also See


Happy New Year – Resolution #1, Network & Data

January 1st, 2011

It’s a new year and time to start getting new years resolutions into action. I’ve moved into my new area in the study so I’ve started setting it up how I like.

The first step is to get my router set up. The router I’m using is a little ‘fit-pc’ box with two ethernet cables. As you can see, it’s pretty tiny but doesn’t pack much in terms of power.


I’ve put my router in bridge mode (so it just acts as a layer two modem/bridge) and let my router then establish a pppoe session with my ISP and do all the routing with iptables (I’ve got to update my firewall script and services running on the box and post up the how-to’s later on for that.) Now the little crappy d-link thing doesn’t fall over and die when torrenting (the router will do all the routing and torrenting without hogging up entries in the NAT table is always a good thing)

One of my new years resolutions is to digitise everything (and make it reliable to do so) so I don’t have to worry about any paper floating around in my life (I HATE paperwork). To do this, I want to add a few more features in my home network, whilst improving security (especially after my VoIP was hacked a while ago)

I’m splitting my network into ‘trusted’ and ‘not so trusted’ zones. The beauty is because my router now has two nicks, putting a small 8 port switch into the equation will allow me to route traffic between these zones in a nice firewalled way.

I’d generally be lazy and put WPA-PSK security on the access point.

I feel safe doing this, from a zdnet article

All you need to do is use WPA-PSK security with a random alpha-numeric pass-phrase that has a minimum of 10 characters. I estimated that a truly random alpha-numeric 10-character pass-phrase using modern single-core computers will take one thousand PCs working in parallel 500 years to crack

I lol’d a bit where it says “.. you could run WEP (104 bit AKA 128) security, which might take a semi-skilled script kiddy using two PCs in an active attack configuration 10 minutes to break.

At the moment, my wireless is secured by only a 64 bit WEP key (shock horror!) Why? Because I’ve got damn devices like the Nintendo DS sitting on here which I’ve been wasting a bit of time on lately that don’t support WPA.

I could hide my SSID, do MAC filtering and not run DHCP, all that jazz, but the end of the story is that this can all be hacked by people who know what they’re doing (Mac addresses can be spoofed, if you’re using your wireless network then you’re still broadcasting stuff.)

I’m not terribly worried at the moment if someone hacks in, they can steal some of my crappy 1.5Mbit internet, they can print to my printer (have fun). My workstations themselves are to some degree protected, but what about when I build my file server and start storing bank statements, tax file numbers? all that stuff? The more layers of security the better! (I learnt this the hard way, trust me)

As I’ve already said, the way I’m lessening my fear of these security problems is by splitting my network into trusted and not so trusted zones.

User Isolation security means that the wireless clients won’t be able to see each other on the network. I’ll allow traffic too and from certain devices on the trusted network (the printer for instance.) but to gain access to any of my secure boxes (Fileserver, other workstations) then wireless clients will have to first connect through WEP, then establish a secured VPN connection into the trusted zone. With this setup, even if someone breaks into my WiFi, good on them, they get crippled net (I might cripple WiFi net bandwidth to the net, not decided yet) and access to.. well, my printer again *sigh*

Network stack lol!