MyTechNotepad

All the tiny little tech things I’ve always forgotten when I need them again … (mostly referring to my Ubuntu desktop). Also for these hints –  use them upon your own risk:

Recover Photos on CF-Card
Download Testdisk/PhotoRec from http://www.cgsecurity.org/wiki/PhotoRec
Extract to directory in /home
Insert CF-Card/USB-Reader
Start PhotoRec in directory through: sudo ./photorec_static
Follow Instructions …

Synology Cloud “wrong ezCloudID” in Cloud Client setup:
enter Server IP address instead of ezCloudID ….

Firefox no longer FTP-Filehandler in Ubuntu
Edit defaults.list as root:
CLI: sudo gedit /etc/gnome/defaults.list <enter>
Add the following line :
Gedit: x-scheme-handler/ftp=nautilus-folder-handler.desktop
Save and close, no need to reboot.

Firefox Tabs down: about:config –> browser.tabs.onTop
Firefox IPv6 activate:
about:config –> network.dns.disableIPv6

LinuxMint disable Hot Corner:
Menu > System Settings > Hot Corners > Disable (for the upper left corner)

VirtualBox USB support: CLI: sudo usermod -aG vboxusers <username>

DNS-Servers for static IP configurations
80.254.79.157 (Monzoon)
80.254.77.39 (Monzoon)
8.8.8.8 (Google)
8.8.4.4 (Google)

manual DNS set up in Linux (LinuxMint/Ubuntu)
# vi /etc/resolv.conf
In resolv.conf insert:
nameserver 80.254.79.157
nameserver 80.254.77.39
nameserver 8.8.8.8

Find out Linux Version in CLI
#cat /etc/*-release

Upload file through FTP by using curl instead of ftp
#curl -u user:password -T file ftp://server/dir/file

Disable the (really annoying) Hot Corners in Linux Mint
Go to system tools / system settings (“Systemeinstellungen” in German)
Switch to “Advanced Mode” (link in lower left corner)
In “Settings” there’s a button called “Hot Corners” which opens the admin GUI

Burn CD/DVD under LinuxMint/Ubuntu
Uninstall Brasero, install K3b

Problem with Ubuntu Network Manager on vanished VPN setup
CLI: killall nm-applet <enter>
       nm-applet <enter>

Setup Truecrypt for read/write access to containers for normal users
In standard installation only admin user can write to decrypted container :(
Generate new group – CLI: sudo groupadd truecrypt <enter>
Add group truecrypt to user – CLI: sudo usermod -aG truecrypt <username>
Add new group to sudoers – CLI: sudo visudo <enter>
Add following lines to sudoers file:
snip—–
# Users in the truecrypt group are allowed to run TrueCrypt as root.
%truecrypt ALL=(root) NOPASSWD:/usr/bin/truecrypt
/snip—–
Generate home directory to  mount to: mkdir /home/<user>/truecrypt
Adjust ownership of directory: sudo chown <user> truecrypt
sudo chgrp <user> truecrypt
Mount truecrypt to home directory:
sudo truecrypt /<path to truecrypt container> /home/<user>/truecrypt

Printer setup on Linux hosts (access to CUPS through localhost):
Install new printer driver (especially for Samsung printers download Linux printer installer),
then you can find this printer in the “available printers” for manual setup
Access CUPS through Browser: http://localhost:631 <enter>
use for printers on (Samba) printer shares:  lpd://<IP address>/blablaprintqueue
(the name of the print queue can be any string)

Problem with Zentyal Server on full root partition
Zentyal/Ubuntu Servers have a “built-in” problem, root partition is by far too small
Quick fix CLI:
sudo apt-get clean <enter>
clear logs in /var/log/ebox , /var/log/asterisk
clear old files in /var/lib/ebox/tmp
clear stuck duplicity backups in /var/lib/ebox/.cache , /var/lib/zentyal/.cache/duplicity ,
search for large files >20M and kill them (make sure you know what you do !!)
sudo find  -size +20M
clear old …generic-pae files in /boot
Resize partitions: http://trac.zentyal.org/wiki/Documentation/Community/HowTo/ResizeRootLVMPartition

Important vi commands I always forget:
1G – go to begin of file
dG – delete all until EOF
Cheat sheet: http://www.lagmonster.org/docs/vi.html

Syslog info on just recent events
CLI: sudo tail -f /var/log/syslog <enter>

Test IP addresses for open resolver
CLI:dig <url> @<IP of open resolver><enter>
host <url> <IP of open resolver> <enter>

Lookup of IPv6 addresses
CLI: nslookup -type=aaaa <URI> <enter>

Reverse lookup of IP address
CLI: host <IP address> <enter>

Mounting Samba Drive to Ubuntu
– make sure smbmount is installed on Ubuntu (CLI: sudo apt-get install samba smbfs)
– generate directory <path in home directory> e.g. by mkdir<path in home directory>
CLI: sudo smbmount //<IP of Samba Server>/path ~/<path in home directory> -o user=<username Samba> <enter>
- first password request is for sudo, next password request is for Samba !!

Zentyal Server
– homepage in /var/www/index.html
– pages of other domains: /srv/www/xy.com

Setting up PGP on TheBat! 5.2.2
A hell of a job, description/help on TheBat! was simply “not very helpful” so I had to find my way myself. The result wasn’t very elegant, but it worked …
– in “TheBat! / Options / OpenPGP / Choose OpenPGP Version” I only found “Internet (RFC-1991)”  so I better installed a higher version …
– go to www.gnupg.org
– click on download / mirror
– select a mirror (ftp://mirrir.switch.ch/mirror/gnupg/)
– go to “binary” on mirror
– download the newest .exe (gnupg-w32-cli-x.y.z.exe)
– install it
– shutdown/restart TheBat!
– in “TheBat! / Options / OpenPGP / Choose OpenPGP Version” I now also found “GNU Privacy Guard (GPG)”
– select “GNU Privacy Guard (GPG)”
– going to “TheBat! / Options / OpenPGP / OpenPGP Key Manager” I got error message “The external key manager application for GnuPG is not specified”
– going to “TheBat! / Options / OpenPGP/ OpenPGP Preferences / Files” –  on the bottom I found “GnuPGP External Key Manager” field which was empty :(
– installed Key Manager “WinPT” from openpgp.org by expanding ZIP-File to c:\Program Files\GNU\GnuPG\WPT\
– in “TheBat! / Options / OpenPGP / OpenPGP Preferences / Files” I  set “GnuPGP External Key Manager” to c:\Program Files\GNU\GnuPG\WPT\WinPT.exe
– going to “TheBat! / Options / OpenPGP / OpenPGP Key Manager –  received error “GPG home directory is not set correctly, …”
– How to change the GnuPG Home Directory? (GnuPG will look for  keyrings (public and private keys) and gpg.conf file.
+ going to  “start / run /regedit”
+ in Regedit, going to HKEY_CURRENT_USER\Software\GNU\GnuPG
+ If an entry  “HomeDir” exists, correct path to your situation (eg. C:\Users\<your name>\AppData\Roaming\gnupg\)
+ If no entry exists, select Edit / new / string value and set it to “HomeDir”, then set correct path to your situation (eg. C:\Users\<your name>\AppData\Roaming\gnupg\)
– in “TheBat! / Options / Preferences / Files” I set
Public Key Ring File to: C:\Users\<your name>\AppData\Roaming\gnupg\pubring.gpg
Private Key Ring File to: C:\Users\<your name>\AppData\Roaming\gnupg\secring.gpg
Random Seed File to: C:\Users\<your name>\AppData\Roaming\The Bat!\random_seed.bin
GnuPGP External Key Manager to: C:\Program Files\GNU\GnuPG\WPT\WinPT.exe
and click OK
– go to “TheBat! / Options / OpenPGP / OpenPGP Key Manager” … again error “home directory bla bla …”, escape until you get “follot what WinPT if offering you”
– generate new key pair
– DONE … wtf

– ATTENTION: the Key Manager now is a small icon in the system try !!!

– ATTENTION: when sending encrypted mail you may get “gpg: [stdin]: encryption failed: unusable public key” when you haven’t signed the received public key of the addressee you want to send mail to

– ATTENTION: whenever generating keys, signing addressee’s pubkey, decrypting mail, etc. you need the once defined pass phrase ! Never forget it, you’ll loose everything !

Using PGP on TheBat! 5.2.2:
– disable S/MIME in Account Properties / Options or when selecting encryption for new mail in “Privacy”
– send your public key as attachment or pasted in your mail to addressee
– import addressee’s public key to your key ring
– open your key manager, select addressee’s key, right click and sign it
– generate a mail, click “privacy”, activate “Encrypt when completed” and click send

Homematic:
– Beim Anlernen eines Rauchmelders darauf achten, dass eine Rauchmeldergruppe automatisch eingerichtet wird, falls es nicht klappt, den Rauchmelder wieder auf Werkszustand zurücksetzen (kann beim Löschen ausgewählt werden) und dann neu anlernen
– Email-Templates hochladen über Startseite>Einstellungen>Systemsteuerung>Zusatzsoftware>Email – Einstellen

Set up Remote Backup Synology NAS over the Internet to other Synology NAS:
– On destination  NAS activate Network Backup in Control Panel
– Map ports 873 and 22 on Firewall of remote NAS to private IP of remote NAS
(Monowall: Firewall -> NAT -> enter port and NAT IP and select “Auto-add a firewall rule
to permit traffic through this NAT rule -> Save -> apply rules)
– On source NAS enable Network Backup
– On source NAS goto Backup -> Create -> Data Backup Task -> … the ususal selections ->
Network Backup Synology Server -> IP: the Public IP of the remote Firewall ->
username/password of remote NAS -> select shared folder of remote NAS ->
enter in “Directory” the name of backup directory to be created on remote NAS ->
enable encryption/compression/reserve/metadata/thumbnails/set bandwidth limit
in order to not overload local Internet uplink
– set backup schedule