IT notes


How to connect using serial (usb/com RJ45) port on macOS: $ sudo cu -s 115200 -l /dev/tty.usbserial-DN04FSAL To bail out when you’re done, type ~. as you would with SSH. Boot example: After installing (zfs on root): The toy:


To upload all packages to packagecloud: package_cloud push immortal/immortal/el/7 immortal_0.19.0_*.rpm --skip-errors for .deb 386 needs to be i386


Gzip all files within a directory: gzip -r ./ or find . -type f ! -name '*.gz' -exec gzip "{}" \;

odroid C2

Disabling blinking blue led: echo none > /sys/class/leds/blue:heartbeat/trigger To make the change permanent add the line to /etc/rc.local


exec is a functionality of an operating system that runs an executable file in the context of an already existing process, replacing the previous executable. exec replaces the current program in the current process, without forking a new process. Examples to use: exec csh This will just replace the existing shell with csh and only need to type exit once Within a script to startup python scripts, for example:


The sockstat command list open Internet or UNIX domain sockets. List open tcp in ipv4: # sockstat -4l Show connectd sockets in port 443 and tcp: # sockstat -P tcp -p 443 -c List unix sockets: # sockstat -u

Ansible ad-hoc

To send a command to all the servers within a playbook: $ ansible all -a "service chronyd restart" -u devops --become What’s an ad-hoc command? An ad-hoc command is something that you might type in to do something really quick, but don’t want to save for later.


Update Freebsd using freebsd-update: Set in /etc/rc.conf: kern_securelevel_enable="NO" kern_securelevel="0" reboot and then: # freebsd-update upgrade -r 10.4-RELEASE # freebsd-update install # reboot # freebsd-update install Repeate then to upgrade to 11.1 freebsd-update upgrade -r 11.1-RELEASE Only security patches: # freebsd-update fetch # freebsd-update install To update the packages: # pkg-static upgrade -f # freebsd-update install A forced upgrade of all installed packages will replace the packages with fresh versions from the repository even if the version number has not increased.


Basic influxdb queries, setup. You can use influx (the influxdb shell) or use the http API on port :8086 Create and apply retention policy to a database: warning this may remove/purge existing data CREATE RETENTION POLICY "30_days" ON collectd DURATION 30d REPLICATION 1 default notice the ending default that means to apply the created policy Show retention policies: > show retention policies name duration shardGroupDuration replicaN default ---- -------- ------------------ -------- ------- autogen 0s 168h0m0s 1 false 30_days 720h0m0s 24h0m0s 1 true Show databases contents (measurements):


To enable WoL (Wake-on-LAN) on macOS: $ sudo pmset womp 1 Then check the settings: $ pmset -g System-wide power settings: Currently in use: standbydelay 10800 standby 1 womp 1 halfdim 1 hibernatefile /var/vm/sleepimage powernap 1 gpuswitch 2 networkoversleep 0 disksleep 10 sleep 1 (sleep prevented by coreaudiod, coreaudiod, iTunes) autopoweroffdelay 28800 hibernatemode 3 autopoweroff 1 ttyskeepawake 1 displaysleep 10 tcpkeepalive 1 acwake 0 lidwake 1