Posts Tagged: code


8
Dec 11

Guide to Persistent Reverse SSH Shells and Port Forwards

Idiot proof setup for persistent reverse shells / port forwards (same thing) under a Ubuntu VM remote and my Dreamhost server, but should apply to nearly* all *nix’s

Continue reading →


26
Oct 11

Unicode Characters in Mendeley Bibliography Breaking Latex?

I use Mendeley for my reference and citation management.

I use TexClipse for (most) of my \LaTeX editing, ViM otherwise.

I use Xelatex / pdflatex for project building.

These don’t always work so well together.  Continue reading →


28
Jul 11

The Road to Coreboot, Part the First: Introduction

Coreboot Logo

So as part of my IAESTE placement with PC Engines, I’m investigating the possibility of them making a new board based around the AMD Fusion series of APU’s  (CPU+(something else, usually GPU) on single die) and for that board to work with the Open Source Coreboot BIOS. This is my story.

Disclaimer

I am not a hardware guy, and have never done any pre-OS x86 hardware programming. This will bore
the pants of anyone who is an x86 expert, but hopefully some will find it useful and will contribute to the Coreboot project. Continue reading →


12
Feb 11

Bolsters Code-Related Rants (An ongoing collection)

FFFFFFUUUUUUUU

FFFFFFUUUUUUUU

  • Logging functions being called with just a variable and no comment as to what the hell it is
  • logging has functions more than logging.info, use them.
    • Debug = useful information if something breaks but isn’t interesting during normal operation
    • info = useful and generally interesting information
    • warn = something went wrong, indicating something should probably be refactored / fixed, but the system could recover from it.
    • error = oh dear jesus fuck the entire site evaporated into a swarm of zombie locusts, I better put something in the error log.
  • Commented out historical code! Using a version control system means you can go back to any point in the history of the codebase and see how we used to do something; you don’t need dozens of lines of extraneous code ‘just in case’
  • Checking in inoperable code to the default branch (I know I’m guilty of this sometimes too). If major changes to one section are being made, do it in a branch, that’s what branches are there for. Then, when the new functionality is stable, update your local code with respect to the default branch, then make sure all the functionality still works and only then commit and check it in to default
  • Non existent or orphan files; if you add a new file,hg add $filename before updating or committing, otherwise noone has any idea whats going on. Ditto removals of files, its hg remove $filename ; rm $filename, not the other way around.

You guys got any to add? I’ll be adding to this as I think of them… / come across them…


31
May 10

Automagic Kernel Cleaning under Ubuntu

Sick of having dozens of old kernels sitting under your /boot/ dir? Want a simpler boot-life? Well we’ve got the solution for you. Continue reading →


17
Apr 10

Add a Twitter @anywhere hovercard to links containing tweeps

Everyone and their dog has a walkthrough of adding @anywhere hovercards to your blog. But the default has a small failing that irked me when I was re-doing my Blogroll (check them out, they’re all great! I promise!), and that was that if you take a tweep, like @god for example, it’ll happily wrap the hovercard around it, but if you have a link to this great status that @god posted, @anywhere won’t pick this @god up.

Continue reading →


9
Apr 10

Listing just dot-files

Its a problem that I’ve come across, and I’m not the only one, so heres what works for me to find those pesky files that start with a .
ls -a | egrep -i "^\."

This only works in the current working directory, which is the normal usage.

FYI the reason that this is problematic is that the ‘.’ symbol is a single character wildcard; most people are familiar with the asterisk ’*’ indicating ‘anything, however long’, whereas the ‘.’ means ‘any single character’.

The command works by looking only at the first character of the file (‘^’, thats called a caret) and then removing the special meaning of ‘.’ by escaping it with the slash.

Update:18/4/10
@stevebiscuit correctly pointed out that the -i flag is unnecessary.

-iinstructs egrep to ignore the case of any matches, so that ‘HeLlO’ matches if you egrep -i for ‘hello’. Since there is no case for the ‘.’ symbol, the -i is pointless.


1
Apr 10

Mod_Rewrite in Apache2

Just incase you forget how to fix this the easy way: Enable mod_rewrite for URL voodoo; (Or any module replacing the

rewrite

)

$sudo a2enmod rewrite
$sudo service apache2 restart

Remember to fiddle with

/etc/apache2/sites-available.*< \pre> and change "AllowOverride none" to "all" in any places that you're having trouble with rewritten URL's

14
Mar 10

Installing and Configuring NS-3 on a Ubuntu System

Network Simulated by NS

An Example of network simulation using NS

NS-3 Appears to have a staggeringly steep learning curve so I hope these posts help out someone else (or me, when i forget all this in a month).

Continue reading →


13
Mar 10

Mercurial Quick Start Cheatsheet

I hadn’t used Mercurial before so I thought it might be a good idea to leave a reminder for me and anyone else who comes across it…

For tidyness, I do all of my dev-stuff (Subversion, Mercurial, CVS, Git etc) under ~/src and only take root privileges when its needed; any good makefile should relocate the necessary files for you at the ‘make install’ or equivalent point.

Update:This article was picked up by the guys at DevCheatSheet.com and I’m really honoured to be included in a site that I’ve been dipping into over the years, so if you need any kind of cheat sheet or quick reference, I highly recommend checking them out. Anyway…

Continue reading →


Load Times Plugin made by Ares Free Download