Quantcast
Channel: BSDnexus
Browsing all 17 articles
Browse latest View live

apt autoclean

To have apt-get/aptitude auto-clean all the downloaded .deb files after running an "update" (to keep as much free space as possible) simply add the following to /etc/apt/apt.conf.d/00autoclean...

View Article


AcerAspireOne Touchpad on Debian

When installing Debian "Testing" on the AcerAspireOne the touchpad does not register a single tap of the pad as a left mouse click. To rectify this add the following line to the file...

View Article


dpkg tips

dpkg is package manager for Debian, and found in most of its derivatives. Programs such as apt and aptitude are front-ends to dpkg. Following are some handy to know dpkg commands. Package Listing To...

View Article

Batch convert audio files

Simple one-liner to batch convert one type of audio file to another using ffmpeg. The example converts .ogg to .mp3 files: for x in *.ogg; do ffmpeg -i "$x" "`basename "$x" .ogg`.mp3"; done

View Article

Files without comments

Use *awk to remove comment lines that start with a '#' making it easier to view the actual configurations/settings cat /path/to/file | awk '!/^#/ {print $0}' [Edit] To remove the blank lines as well as...

View Article


Image may be NSFW.
Clik here to view.

Generating SSL certificates

Generate server private key The first task is to create a server private key. In this example, a key of 1024 bits is created and the passphrase is encrypted using tripple DES: openssl genrsa -des3 -out...

View Article

Config cleanup

A one liner to remove all stale pkg config files on a system after the main programs have been removed. WARNING: There's no going back so make sure you do want all these config files removed and that...

View Article

Parse JSON on the CLI

Simple one-liner to parse JSON on the command line: 1 cat fileof.json | python -mjson.tool

View Article


PostgreSQL CSV output from the CLI

Get CSV output from a postgreSQL database directly from the CLI: 1 psql -A -F ',' -t -c 'select * from tablename;' You can then, clearly, redirect the output as desired.

View Article


Pipe filenames to tar

Simple oneliner that demonstrates the principle of how to specify the files you wish tar to archive (or extract) by piping to it: cat filenames.txt | tar cvzf ~/try.tgz -T -

View Article

gpg-agent pinentry

Sometimes, the default setting of the gpg-agent is to use the gtk version of the pinentry program, however this may not be desirable on headless servers. It is possible to alter this behaviour by...

View Article

open_basedir restriction in effect

PHP threw up this error today PHP Warning: Unknown: open_basedir restriction in effect. File(/foo/index.php) is not within the allowed path(s): (/bar/:/tmp/:/usr/share/pear/) Seems open_basedir is set...

View Article

gpg quick guide

GENERATE KEY PAIR Generate personal key pair (private and public) gpg --gen-key You will be prompted for a password for private key LISTING / VIEWING KEYS IN KEYRING List public keys in your gpg...

View Article


roundcube doesn’t display dates

Roundcube has a known issue where date fields are blank. Apparently it requires a timezone directive set, in /etc/php.ini add/edit this line: date.timezone = "US/Hawaii" You can change “US/Hawaii” with...

View Article

recursion power of

A book I was reading suggested I write a recursive function that calculated a power of a number. Here’s my attempt – comments and suggestions welcome: double powerup( double num, double powr) { if (...

View Article


udev interface naming

Following a hardware failure on a Ubuntu box, it seems that simply swapping the disk to a similar hardware system is not as easy as I had thought. It would appear that udev attempts to keep a permanant...

View Article

implementing my own strdup

While chatting on IRC last night I entered conversation about strdup(), a C function I had never used or encountered. I was then challenged to write my own. Checking the man page had me thinking about...

View Article

Browsing all 17 articles
Browse latest View live