User Tools

Site Tools


Translations:
en

en:linux:start

Linux

Preferences

Titlebar-Icons

gsettings set org.gnome.desktop.wm.preferences button-layout ':minimize,maximize,close'

Terminal-Width

stty rows 50 cols 150

if linebreak does not work this can help in ~/.bashrc:

shopt -s checkwinsize
#if [ $(tty) == '/dev/ttyS0' ]; then
#  trap resize DEBUG
#fi
#resize-befehl in xterm
export PROMPT_COMMAND="resize &>/dev/null ; $PROMPT_COMMAND"

ppp ifup-script

Script in /etc/ppp/ip-up.d must not have extension Quelle

example: ppp-default-route in separate routing-Table:

PPP_LOCAL=$4
PPP_REMOTE=$5
PPP_IFACE=$1

ip route flush table telekom
ip route add $PPP_REMOTE/32 dev $PPP_IFACE src $PPP_LOCAL table telekom
ip route add default dev $PPP_IFACE table telekom
ip route show table telekom
exit 0

apt-get force ipv4

apt-get -o Acquire::ForceIPv4=true update

Quelle

permanent (as root):

echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99force-ipv4

Quelle

basic x-server

apt-get install --no-install-recommends xserver-xorg xinit openbox policykit-1 xterm xfonts-base

simple Mailserver

as Relay-Server (sending Mails over external Mailserver) for System-purposes (infos, backup,…)

https://linuxundich.de/gnu-linux/system-mails-ohne-einen-mail-server-mit-ssmtp-verschicken/

screen

wget

-P download in dir

wget <file.ext> -P /path/to/folder

-O download as file

wget <file.ext> -O /path/to/folder/file.ext

processinfo

ps -o pid,args -C tcpdump

nano

Jump to line: Ctrl+Shift+- (Ctrl+_)

Replace: Alt+R

settings

sudo nano /etc/nanorc

Cursorposition

## Constantly display the cursor position in the status bar.  Note that
## this overrides "quickblank".
set constantshow #temporär strg+C, 

linenumbers

## Display line numbers to the left of the text.
set linenumbers  # alt+# to disable temporarily

TAB-width

#/etc/nanorc
set tabsize 4
#temporary setting it (e.g. for Patches)
nano -T 8 datei

storage check

#filesystem:
sudo fsck -f /dev/sdb1
#check for bad sectors
sudo badblocks -nsv /dev/sdb

NTP

apt-get install ntp
service ntp stop
ntpdate ptbtime1.ptb.de
service ntp start

set time

#timedatectl --help
timedatectl set-timezone CET #timezone (CET/CEST)
date -s "2020-10-29 19:14" #time
hwclock -w #set RTC setzen, else time will be wrong after next reboot

update-alternatives

sudo apt-get install gcc-8-arm-linux-gnueabihf
sudo update-alternatives --install /usr/bin/arm-linux-gnueabihf-gcc arm-linux-gnueabihf-gcc /usr/bin/arm-linux-gnueabihf-gcc-8 50
sudo update-alternatives --config arm-linux-gnueabihf-gcc
arm-linux-gnueabihf-gcc --version

other example

sudo update-alternatives --install /usr/bin/calc calc /usr/bin/gnome-calculator 10

renaming

File test will be renamed into test.bak (same directory)

mv /home/frank/test{,.bak}

irssi

config

Server+nick:

irssi -n NICK #start irssi with nickname
/network add -nick NICK -autosendcmd "/msg nickserv IDENTIFY *******" fn
/server add -auto -ssl -network fn chat.freenode.net 7070 #ports 6697, 7000 and 7070 for SSL-encrypted connections.
/SET nick xxx
/SET alternate_nick xxx

/nick alternatenick
/msg NickServ IDENTIFY mainnick password
/msg NickServ GROUP

https://freenode.net/kb/answer/registration

/alias nick_recover msg NickServ GHOST $0 $1; wait 2000; msg NickServ RELEASE $0 $1; wait 2000; nick $0; wait 2000; msg NickServ IDENTIFY $1
/network modify -autosendcmd "/nick_recover NICK PASSWORD" fn
/SET server_reconnect_time 300

https://irssi.org/documentation/startup/

switch windows

/window 1-x #1=server-window

Ctrl+P (previous)/ctrl+N (next)

/win list #shows open windows in the Server-Status (1)

Away mode

/away grund #start awaymode (Nachrichten shown in Server-window #1)
/away #stop away mode

udev

same serial-adapter with Symlink based on USB-Ports (behind Hub)

https://askubuntu.com/questions/49910/how-to-distinguish-between-identical-usb-to-serial-adapters

udevadm info --attribute-walk --path=/sys/bus/usb-serial/devices/ttyUSB0

/etc/udev/rules.d/11-ttyusb.rules:

#r2 (first port) roothub-port.hubport
#    KERNELS=="1-3.1:1.0"
#    KERNELS=="1-3.1"
#r64 (second port=3)
#    KERNELS=="1-3.3:1.0"
#    KERNELS=="1-3.3"
KERNEL=="ttyUSB*", KERNELS=="*-*.1*", SYMLINK+="ttyUSB_R2"
KERNEL=="ttyUSB*", KERNELS=="*-*.3*", SYMLINK+="ttyUSB_R64"

sshd

qnap (entware)

nano /opt/etc/ssh/sshd_config #ggf. optionen anpassen (hostkey ecdsa/ed.../...)
ps | grep ssh
kill PID #PID= pid von /opt/sbin/sshd
/opt/sbin/sshd -E /tmp/sshd.log -o LogLevel=DEBUG3
tail -f /tmp/sshd.log
#bei Fehler "Bad ownership":
chmod go-w ~/;chmod 700 ~/.ssh;chmod 600 ~/.ssh/authorized_keys
#wenn fertig
/opt/etc/init.d/S40sshd restart

kernel kernelconfig (/proc/config.gz)

# modprobe configs
# zcat /proc/config.gz | grep -i hwmon
CONFIG_HWMON=y
# CONFIG_HWMON_DEBUG_CHIP is not set
# CONFIG_SENSORS_IIO_HWMON is not set
CONFIG_THERMAL_HWMON=y

mv-alternative

rsync -avh --progress --remove-source-files source target/
#delete empty directories (not done by rsync)
find source/ -type d -empty -delete

other

force fsck

in kernel-cmdline:

fsck.mode=force

rc.local

VNC-Server

based on https://www.scivision.dev/vncserver-setup-on-ubuntu/

apt install tightvncserver openbox
apt install lxterminal firefox-esr --no-install-recommends

~/.vnc/xstartup

#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey

unset SESSION_MANAGER
exec openbox-session &

~/startVNC.sh

#!/bin/sh
vncserver :1 -geometry 1024x768 -depth 8

do not forget to set execute rights

chmod +x ~/startVNC.sh ~/.vnc/xstartup

i setart the script with rc.local (see above), but a init-script is also possible

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-18-04-de

locales

/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory

Solution:

if not yet done, generate locales

locale-gen de_DE.UTF-8

add this to /etc/environment:

LC_ALL=de_DE.UTF-8
LANG=de_DE.UTF-8

maybe again

dpkg-reconfigure locales

now error should be fixed

locale -a

Solution using /etc/default/locale was not working for me

en/linux/start.txt · Last modified: 2021/10/31 13:10 by frank