Aug 23, 2018
#bosh
#cheat
#cheatsheet
#sheet
BOSH is a project that unifies release engineering, deployment, and lifecycle management of small and large-scale cloud software.
Check your environment:
$ bosh env Set your deployment environment:
$ export BOSH_DEPLOYMENT=foo if have multiple deployments in same dir better to use -d <deployment-name> since many commands are bound to this variable.
To recreate your environment (virtualbox), remove the line that start with current_manifest from the file state.
…
Aug 20, 2018
#zfs
#swap
To add more swap on a ZFS system:
# zfs create -V 64G -o org.freebsd:swap=on -o checksum=off -o compression=off -o dedup=off -o sync=disabled -o primarycache=none tank/swap2 To add it:
# swapon /dev/zvol/tank/swap2 To resize you could first remove it:
# swapoff /dev/zvol/tank/swap Then destroy it:
# zfs destroy tank/swap
…
Aug 11, 2018
#history
#shell
To avoid having command in history just prefix them with an empty space:
$⎵ uname If using zsh:
$ echo "" > ~/.zsh_history & exec $SHELL -l
…
Aug 10, 2018
#macos
#sparse
#install
#vmware
To create an install disk using an spare disk:
$ hdiutil create -size 6GB -fs JHFS+ -volname "macOS_installmedia" -type SPARSE ~/Desktop/macOS_installmedia Mount it (or double-click in Finder to mount):
$ hdiutil mount ~/Desktop/macOS_installmedia.sparseimage Use the createinstallmedia:
$ sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/macOS_installmedia --applicationpath /Applications/Install\ macOS\ High\ Sierra.app
…
Jul 28, 2018
#nato
#alphabet
Symbol Code word Pronunciation A Alfa Al fah B Bravo Brah Voh C Charlie Char Lee D Delta Dell Tah E Echo Eck Oh F Fox Foks Trot G Golf Golf H Hotel Hoh Tell I India In Dee Ah J Juliett Jew Lee Ett K Kilo Key Loh L Lima Lee Mah M Mike Mike N November No Vem Ber O Oscar Oss Car P Papa Pah Pah Q Quebec Keh Beck R Romeo Row Me Oh S Sierra See Air Ah T Tango Tang Go U Uniform You Nee Form V Victor Vik Tah W Whiskey Wiss Key X X-ray Ecks Ray Y Yankee Yang Key Z Zulu Zoo Loo 0 Zero Zee Row 1 One Wun 2 Two Too 3 Three Tree 4 Four Fow Er 5 Five Fife 6 Six Six 7 Seven Sev En 8 Eight Ait 9 Nine Nine Er
…
Jun 21, 2018
#zfs
#send
#receive
#root
To send a zfs dataset being no root, on the origin server:
# zfs allow -g wheel send,snapshot,hold tank/foo On the receiver, create the dataset and allow users in group wheel:
# zfs create -o mountpoint=/foo tank/foo # zfs allow -g wheel compression,mountpoint,create,mount,receive tank/foo # umount /foo On the origin server create the snapshot to send:
# zfs snapshot -r tank/foo On the origin server send the dataset by using:
…
Jun 19, 2018
#chrome
#paste
To enable paste in chrome, open the console and enter:
var allowPaste = function(e){ e.stopImmediatePropagation(); return true; }; document.addEventListener('paste', allowPaste, true);
…
Jun 15, 2018
#freebsd
#kernel
#kldload
To load kernel modules after local disks are mounted add this to /etc/rc.conf:
kld_list="fuse" in this case module fuse will be loaded
…
Jun 13, 2018
#freebsd
#ncpu
#sysctl
To get an overview of the system:
# sysctl -a | egrep -i 'hw.machine|hw.model|hw.ncpu' hw.machine: amd64 hw.model: Intel(R) Xeon(R) Silver 4110 CPU @ 2.10GHz hw.ncpu: 16 hw.machine_arch: amd64
…
Jun 12, 2018
#zfs
#moosefs
#dfs
Create a small distributed file system using 2 servers one acting as a mater/chunkserver and other only as a chunkserver.
Install the required packages:
pkg install moosefs3-cgi moosefs3-cgiserv moosefs3-chunkserver moosefs3-client For the master just add:
pkg install moosefs3-master In all the servers add to your /etc/hosts and entry for the mfsmaster:
X.X.X.X mfsmaster Before starting the master, crate the file /var/mfs/metadata.mfs with:
MFSM NEW Create a pool to share:
…
Jun 12, 2018
#freebsd
#MANIFEST
#bsdinstall
#hetzner
If when trying to install FreeBSD using bsdinstall you get:
"Error while fetching file:///usr/freebsd-dist/MANIFEST" - no such file or directory Try to:
[email protected]:~ # mkdir -p /usr/freebsd-dist/
[email protected]:~ # touch /usr/freebsd-dist/MANIFEST And then start again
…
Jun 11, 2018
#ctrl
#kill
#quit
To send a quit signal to the process:
ctrl-\ # (backslash) This will send a SIGQUIT
…
Jun 7, 2018
#python
#site-packages
To find the python site-packages paths:
$ python -m site
…
Jun 1, 2018
#dns
#tcp
#unbound
May 30, 2018
#ssh
#CanonicalDomains
SSH Canonicalization
CanonicalDomains example.com example.net example.org # CanonicalizeFallbackLocal no CanonicalizeHostname yes Host *.example.com IdentityFile ~/.ssh/exampleCOM User foo Host *.example.net IdentityFile ~/.ssh/exampleNET User foo Host *.example.org User foo IdentityFile ~/.ssh/exampleORG more info: https://dotfiles.tnetconsulting.net/articles/2016/0109/ssh-canonicalization.html
…
May 29, 2018
#firewall
#pfsense
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:
…
May 28, 2018
#deb
#rpm
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
…
May 25, 2018
#gzip
Gzip all files within a directory:
gzip -r ./ or
find . -type f ! -name '*.gz' -exec gzip "{}" \;
…
May 15, 2018
#odroid
#led
Disabling blinking blue led:
echo none > /sys/class/leds/blue:heartbeat/trigger To make the change permanent add the line to /etc/rc.local
…
May 14, 2018
#exec
#shell
#syscall
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. https://en.wikipedia.org/wiki/Exec_(system_call)
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:
…