Sometimes you want to install latest version of selected software package while keeping base system stable. Then installing from source is a safe option to proceed.
First, you have to include sources from fresh system version, below is example taken from Ubuntu, I selected natty (/etc/apt/sources.list):
deb-src http://pl.archive.ubuntu.com/ubuntu/ natty main restricted
Then you should refresh package list:
sudo apt-get update
and install dependencies:
sudo apt-get build-dep ccache
and finally build the new version of a package (note that no root account is needed for that step):
apt-get -b source ccache
As a result there’s a *.deb package, install it:
sudo dpkg -i ccache*.deb
That’s all!
I assume you want to encrypt some files using your public GPG key. I’ll focus on simplicity rather than completeness (minimal steps required to implement encryption).
First you have to generate key pair:
$ mkdir -p ~/.gnupg
$ gpg --gen-key
Then see your new key ID and export it to public key storage:
$ gpg --list-keys # get KEY_ID from output
$ gpg --keyserver "hkp://subkeys.pgp.net" --send-key <KEY_ID>
On remote machine import the key and make it trusted (to avoid warnings during encryption):
$ gpg --keyserver "hkp://subkeys.pgp.net" --recv-keys <KEY_ID>
$ gpg --edit-key <KEY_ID>
> trust
Then you can used this key to encrypt files and delete original (if needed):
$ gpg -r <KEY_ID> --output <FILE>.gpg --encrypt <FILE>
$ rm <FILE>
And the decryption (on host where private key is stored):
$ gpg -r <KEY_ID> --output <FILE> --decrypt <FILE>.gpg
The simplest way to monitor free disk space on Linux serwer, just place it in crontab:
0 8 * * * df -h | awk '/^\// && $5 > 95 { print "missing space", $0 }'
and ensure e-mail to this user is forwarded to you then you will see e-mail when occupied space is higher than 95% on any disk.
Pretty simple.
Current project I’m working on benefits from automated test suite run on few Linux-based devices. Tests are running 24×7, but sometimes device hangs (reason is still under investigation) and SSH access is blocked then.
In order to track the problem I redirected syslog (busybox-based, BTW) via network and added local automatic monitoring service that will show me when a part of my test installation go down.
(more…)
For delivering e-mail locally I’m using fetchmail (POP3 based) + local SMTP daemon (for outgoing e-mail). I’d like to see when new e-mail arrives to my desk. It’s pretty easy if you connect classic procmail with modern notification tools based on local message buses.
For GNOME command line interface to internal message is notify send. I’m adding call inside my ~/.procmailrc (after filtering out spam e-mail of course):
:0hc
| grep "^From:\|^Subject:" > /tmp/mail.notify-send; DISPLAY=:0.0 notify-send "`cat /tmp/mail.notify-send`"
The result looks like this:
