User Tools

Site Tools


linux

Linux

Networking

Set keep-alive time for TCP connections

echo 120 >/proc/sys/net/ipv4/tcp_keepalive_time
/etc/sysctl.d/90-tcp-keepalive.conf
net.ipv4.tcp_keepalive_time = 120

View the fingerprint of SSH host key

ssh-keygen -l [-f input_keyfile]

$ ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key
2048 60:b5:1f:99:c3:13:49:14:9b:f0:bb:3c:d0:61:3b:47 /etc/ssh/ssh_host_rsa_key.pub (RSA)

SSH client keep alive

/etc/ssh/ssh_config

ServerAliveInterval 60

Quiet SSH login

Disable MOTD per user:

touch ~/.hushlogin

Desktop

Change default applications based on MIME-Type

For changing the default application for certain MIME-Types edit/create the file ~/.local/share/applications/defaults.list

[Default Applications]
text/html=google-chrome.desktop

The system-wide config resides in /usr/share/applications/defaults.list

Find all MIME-Types associated with gedit:

$ grep gedit /usr/share/applications/defaults.list

Change user defaults from gedit to juffed:

grep gedit /usr/share/applications/defaults.list | sed  's/gedit/juffed/g' >>~/.local/share/applications/defaults.list

Associated applications

.local/share/applications/mimeapps.list

Wine associations

~/.local/share/applications/wine-extension-*.desktop

Change default applications using update-alternatives

# update-alternatives --config editor
# update-alternatives --config x-www-browser

System information

man: “biosdecode parses the BIOS memory and prints information about all structures (or entry points) it knows of.”

# biosdecode

man: “dmidecode is a tool for dumping a computer's DMI (some say SMBIOS) table contents in a human-readable format.”

# dmidecode

File systems

Info

Output superblock info

tune2fs -l /dev/sdX?

SSD

Manual TRIM

fstrim -v /

Consider running a cronjob, e.g. weekly run fstrim

0 0 * * 0 fstrim /

Automatic TRIM

Mount filesystem with discard option.

Wildcard DNS

:FIXME: Move into dnsmasq

http://drhevans.com/blog/posts/106-wildcard-subdomains-of-localhost

# aptitude install dnsmasq
/etc/dnsmasq.d/localhost.conf
address=/localhost/127.0.0.1
/etc/dnsmasq.d/primarydns.conf
server=192.168.0.1

Configure local DNS to use dnsmasq as primary DNS source.

/etc/resolv.conf
nameserver 127.0.0.1

Finally, restart dnsmasq.

ATI driver

Set low profile

echo low >/sys/class/drm/card0/device/power_profile

Linux Live USB Creators

Programs for creating Linux Live USB systems.

linux.txt · Last modified: 2012-09-09 06:42 CEST by dominik