linux

warning: Creating default object from empty value in /data/web/1/000/027/003/273448/htdocs/panticz.de/modules/taxonomy/taxonomy.pages.inc on line 33.

VMware Player

wget -q --no-check-certificate https://raw.githubusercontent.com/panticz/installit/master/install.vmware-player.sh -O - | bash -

#!/bin/bash

URL=https://download3.vmware.com/software/player/file/VMware-Player-14.0.0-6661328.x86_64.bundle

# download
wget -q ${URL} -O /tmp/${URL##*/}

# install
sudo /tmp/${URL##*/} --console --required --eulas-agreed

sudo apt-get install -y open-vm-tools

Links
https://docs.vmware.com/en/VMware-Workstation-Player/12.0/com.vmware.player.linux.using.doc/GUID-42F4754B-7547-4A4D-AC08-353D321A051B.html

openconnect

echo pass1234 | openconnect --no-cert-check vpn.example.com --user foo

start-stop-daemon --start --make-pidfile --pidfile "${VPNPID}" \
--stderr "${VPNERRFILE}" --stdout "${VPNLOGFILE}" \
--background --exec /bin/bash \
-- -c "exec /usr/sbin/openconnect --pid-file=\"${VPNPID}\" ${!VPNOPTS} ${!SERVER} <<< \`echo \"${!PASSWORD}\"\`"

SNMP: Linux software RAID state

Compile snmp-swraid
apt-get install -y git make build-essential libsnmp-dev
export GIT_SSL_NO_VERIFY=true
git clone https://github.com/jrossi/snmp-swraid.git /tmp/snmp-swraid
cd /tmp/snmp-swraid
make

tar cjf snmp-swraid.ubuntu-$(lsb_release -sr).tar.bz2 SWRAID-MIB.txt swRaidPlugin.so

# install
apt-get install -y snmpd snmp-mibs-downloader
wget -q http://dl.panticz.de/snmp-swraid/snmp-swraid.ubuntu-$(lsb_release -sr).tar.bz2 -O /tmp/snmp-swraid.ubuntu.tar.bz2
tar xjf /tmp/snmp-swraid.ubuntu.tar.bz2 -C /tmp
cp /tmp/SWRAID-MIB.txt $(find /var/lib -name ietf)

OpenFortiGUI

Install FortiClientSSL VPN client
wget -q http://www.unibamberg.de/fileadmin/rz/vpn/Linux/VPN_Linux_FortiClient.tar.gz -O /tmp/VPN_Linux_FortiClient.tar.gz
sudo tar xzf /tmp/VPN_Linux_FortiClient.tar.gz -C /opt/
sudo /opt/forticlientsslvpn/fortisslvpn.sh

Install openfortigui
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 2FAB19E7CCB7F415
echo "deb http://styrion.at/apt/ ./" | sudo tee /etc/apt/sources.list.d/styrion.list
sudo apt-get update
sudo apt-get install openfortigui

Compile

LTSP Webcam

export LTSP_HANDLE_DAEMONS=false
ltsp-chroot -p -a amd64 /bin/bash
apt-get install -y guvcview
echo 'KERNEL=="video*", GROUP="video", MODE="0666"' > /etc/udev/rules.d/99-webcam.rules
ltsp-update-image

Links
https://wiki.ubuntuusers.de/LTSP/Lokale_Webcam_nutzen/

rsync

# on-the-fly backup (backup whole running system)
rsync -av --delete --numeric-ids --exclude=dev/* --exclude=proc/* --exclude=sys/* --exclude=tmp/* --exclude=media/* root@example.com:/ .

# limit bandwith to 2 mbit/s
rsync --bwlimit=2000 --delete -avz root@www.example.com:/ /media/backup/www.example.com/$(date -I)/

# specify SSH key and configuration
sudo rsync -av \
-e "ssh -i /home/foo/.ssh/id_rsa -F /home/foo/.ssh/config" \
--delete \
--numeric-ids \
-av \
/from/dir/ root@192.168.0.1:/to/dir

find

# find files without read / write permissions for other
find /media/foo /media/bar ! -perm -o+rw -exec ls -l {} \;
find /media/foo /media/bar -ctime -1 -type f ! -perm -go+rw -exec chmod a+rw {} \;
find /media/foo /media/bar -1 -type d ! -perm -go+rwx -exec chmod 777 {} \;

# find all empty files
find /tmp -type f -empty

# find empty directories
find . -type d -empty

# print file content
find ./ -type f | while read f; do printf "\n# file %s\n" "$f"; cat "$f"; done

# find files by date
find /path/to/dir -newermt "yyyy-mm-dd"

# list all files modified on given date

curl

# authentification
curl www.example.com --user username:password

Syndicate content