Rexxer

Some tips for me and other

Linux

DHCP debugging with tcpdump

http://sysadmin.wikia.com/wiki/DHCP_debugging_with_tcpdump tcpdump filter to match DHCP packets including a specific Client MAC Address: tcpdump -i br0 -vvv -s 1500 ‘((port 67 or port 68) and (udp[38:4] = 0x3e0ccf08))’ tcpdump filter to capture packets sent by the client (DISCOVER, REQUEST, INFORM): tcpdump -i br0 -vvv -s 1500 ‘((port 67 or port 68) and (udp[8:1] = 0x1))’

Shell + echo a random string from a file

shuf -n 1 /usr/local/etc/file.txt

Arduino Uno + Ubuntu + Firmware + command line

1. Install avrdude: sudo apt-get install avrdude 2. Run the command: avrdude -F -V -c arduino -p ATMEGA328P -P /dev/ttyUSB0 -b 115200 -U flash:w:firmware.hex

RRDTool script

Very usefull script for RRDTool. Was copy-pasted from someones blog (can’t recollect the link) – thanks to the author. #!/bin/bash # Путь к исполнимому файлу rrdtool RRDTOOL=/usr/bin/rrdtool # Путь к базе, в которой храниться температура DATABASE=/usr/local/rrd/space-temperature.rrd # Периодичность поступления данных в базу (сек) – соответственно должен быть настроен CRON PERIOD=60 # Команда для получения текущей […]

PFSense + Sarg reports

I met a strange behavior in PFSense Sarg module. Reports didn’t appear and sarg index.html didn’t generated. Work config for success report: Report Options /usr/pbi/sarg-amd64/etc/sarg/sarg.conf: user graphics remove temporary files generate the main index generate the index tree overwrite report use comma instead pint in reports report_type topusers topsites sites_users users_sites date_time denied auth_failures site_user_time_date […]

Another script for temperature monitoring on PFSense

Just the script: #!/bin/sh cd /usr/local/etc S0=`/usr/local/etc/digitemp_DS9097 -t 0 -q -s /dev/cuau0 -o\%.C` #date=`date -j +”%Y-%m-%d %H:%M:%S` #echo “<tr><td align=center>Temperature for $date</td></tr></table></div>” >> /usr/local/www/temp/index.html tmp1=`cat /tmp/temp.tmp` flag=`expr $S0 – $tmp1` echo $S0 > /tmp/temp.tmp # Prepare a mail echo “To: admin@domain.com” > mail.txt echo “From: admin@domain.com” >> mail.txt echo “Subject: Server room = $S0” >> […]

Windows 2012 Terminal Services + Thinstation + cursor issue

I have a Windows Server 2012 and users connect to it via RDP. They have thin clients Wyse 3150 with ADM Geode. If they use built client they get artifacts on a screen after 5-10 min. If they use Linux client from PXE (Thinstation 2.2.2i) they have issues with a cursor – it disappears suddenly […]

Zoneminder + better quality for generated video

I got alerts e-mails with generated video with low quality and it annoyed me. I had only these settings in Options – Image – FFMEG_OUTPUT: -r 25 The image size was 520kb. I got better quality with: -c:v libx264 -preset medium -tune film The image size became 4024Kb.  

Tp-link MR3020 + OpenWRT + Webcam + 220V relay switch

I downloaded this firmware http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin Flashing (links from then on): cd /tmp wget http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin mtd -r write /tmp/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin firmware done – router will reboot. Connect to 192.168.1.1 via telnet: telnet 192.168.1.1 Run: passwd and change the password for root. Now you can connect to the router via ssh. Configure the network: /etc/config/network I prefer to […]

Ubuntu + normal VNC

Human access to the VNC 🙂 Add the strings below to /etc/lightdm/lightdm.conf: [VNCServer] enabled=true command=Xvnc -SecurityTypes None depth=16 width=1204 height=768 Then: sudo service lightdm restart  

Previous Posts Next posts