Powersave scripts doesn't get triggered after upgrading to Ubutnu 15.04 is depending on the switch to systemd instead of upstart. What you need to do is put a new script in udev rules that actually triggers the pm-powersave scripts:

In /etc/udev/rules.d/powersave.rules you would put something like this:

SUBSYSTEM=="power_supply", ATTR{online}=="0", RUN+="/usr/sbin/pm-powersave true"
SUBSYSTEM=="power_supply", ATTR{online}=="1", RUN+="/usr/sbin/pm-powersave false"

After you adjust that your powersaving should be back to whatever it was before the upgrade to 15.04.

Sunday, 30 November 2014 00:00

ownCloud and Android CalDAV won't sync?

Written by

If you have problems getting sync to work with latest Android CalDAV syn adapter app (ver 1.8.1) and ownCloud (7.0.3) the you are affected by issue 226:

https://github.com/gggard/AndroidCaldavSyncAdapater/issues/226

So basically what you need to do is add a URL with port number in your config/config.php to the array, so it looks like this:

  'trusted_domains' =>
  array (
    0 => 'owncloud.scarleo.se',
    1 => 'owncloud.scarleo.se:443',
  ),

And voila! Sync is back again, happy days!

Monday, 21 April 2014 00:00

Add custom iptable rules to csf

Written by

To add custumcsf rules to csf either add the file csfpre.sh or csfpost.sf in /etc/csf and in that file put your complete iptables command and it will be executed either before or after csf rules. Example:

iptables -t nat -I POSTROUTING -o eth0 -s 10.8.0.0/24 -j MASQUERADE

You probably will find after installing your camera that /dev/video0 doesn't exist, you will then need to load some kernel modules:

sudo modprobe uvcvideo
sudo modprobe bcm2835-v4l2

That is basically it, /dev/video0 should now have been created and motion works with it by default. To have those modules loaded at boot just put them in /etc/modules

 

Saturday, 05 April 2014 00:00

maldetect finds malware on your server

Written by

Maldet is a small script that uses clamd plus it's own definitions to find malware, mainly it is useful to scan folders where you have web site installations to detect if any installation has been compromized or files has been uploaded. It is not perfect but finds many injects, command shells etc. It is an easy installtion,  have a look at their website here:

https://www.rfxn.com/projects/linux-malware-detect/

You can also easily help improve it by submitting your own findings.

Saturday, 05 April 2014 00:00

Thunderbird Lightning multiple calendar

Written by

I use ownCloud to sync my calendars between devices, which generally works really great. I also like to keep work and private calendars separated so I easily can sort out the ones I do not need at the moment. But here is where the problem starts with Lightning plugin for Thunderbird, it is not capable of saving multiple passwords for the same domain. This is a big drawback but can be solved, of course. In ownCloud you can share calendars between ownCloud accounts, so just share your work account calendar with your Private account, you will now have access to both calendars with the same password but still on two separate URL's.

Saturday, 05 April 2014 00:00

Create a 32-bit wine prefix

Written by

If you run a 64-bit Linux version and intend to run Wine you are by default going to create a 64-bit Wine prefix if you launch Wine. To create a 32-bit prefix instead you will have to move the existing ~/.wine and then launch Wine like this:

WINEARCH=win32 winecfg

Now you have a 32-bit prefix, and next time you launch Wine it is going to use that 32-bit environment instead. Why 32-bit? If you need .NET you have to run 32-bit, it just won't install in 64-bit Wine right now.

You can also add WINEPREFIX=~/win32 to just rune wine in another prefix


dpkg --get-selections > selections.txt save the .txt file to a safe place then once reinstalled dpkg --set-selections < selections.txt followed by dselect update and apt-get dselect-upgrade show give you back your installed packages.

Saturday, 15 March 2014 00:00

High load but no processes using cpu?

Written by

Somtimes you can see very high load but nothing obviuous that is using CPU time. That might be the uninterruptable processes, the D state. This is how you find them:

top -b -n 1 | awk '{if (NR <=7) print; else if ($8 == "D") {print; count++} } END {print "Total status D: "count}'

That number should correspond to the excessive load you see on your system. Just kill the processes and find out what is causing them, in my case it was a PHP cron job causing them.

Sunday, 02 March 2014 08:44

Get external IP from terminal

Written by

You can easily get your external IP from ifconfig.me:

$curl ifconfig.me/ip

Also check their web site for more IP related resuest/responses, i.e.:

$curl ifconfig.me/host
Page 1 of 2