GNU find
March 30, 2018 — 14:51

Author: silver  Category: linux windows  Comments: Off

Just a few useful ‘find’ examples


find . -path ./foo -prune -o -name bar
find /home \( -path /usr/data -prune -o -path /usr/src \) -prune -o -name foo -print
find . -name Makefile -not -path foo
find . -type d ! -regex .*\/\(foo\|bar\).* \;


find . -perm -775
find . -perm /u+w,g+
find . -printf "%m:%f\n"
find . -printf "%m %h/%f\n"|grep -v '^\(644\|755\)'

Print date:

find -type f -printf '%TF %.8TT %p\n'


find.exe . -name *.exe -exec certutil -hashfile {} SHA512 ; >c:\hash.txt

Python 3
March 30, 2018 — 14:26

Author: silver  Category: dev  Comments: Off

Print modules:

python3 -c "import sys;print (sys.path)"
python3 -c "import sys;print (sys.modules)"
python3 -c "help('modules')"
python3 -c "help('modules package')"
pydoc3 modules


  • Location in Debian: /usr/lib/python{3}/dist-packages/pkgname/{}
  • Other distro’s use “site-packages”

pip3 install pkgname
pip3 uninstall pkgname
pip3 freeze
python3 -m pip install pkgname

import pip
sorted(["%s==%s" % (i.key, i.version) for i in pip.get_installed_distributions()])


$ pip3 install virtualenv
$ mkdir workdir && cd workdir
$ virtualenv project
$ source project/bin/activate
$ pip3 install requests

(and/or git clone + python3 install / etc)

$ deactivate
$ rm -rf project


  • make sure your does not have the same name as package
  • print syntax changed from python2 to 3: print ("foo")
March 30, 2018 — 9:50

Author: silver  Category: dev  Comments: Off

List installed modules:

Pick one :)

  • perl -V
  • perldoc <module name>
  • perldoc perllocal
  • instmodsh
  • cpan -[l,a]


perl -e 'use ExtUtils::Installed; foreach (ExtUtils::Installed->new()->modules()) {print $_ . "\n";}'

Install modules in homedir:

  • install “local::lib” module
  • print settings: perl -Mlocal::lib
  • add to .bashrc: eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"

Then there’s also “Perlbrew“.

Updating CPU Microcode
March 28, 2018 — 12:50

Author: silver  Category: linux windows  Comments: Off


Tool from Intel called “BIOS Implementation Test Suite” that can do several things including handling microcode:


  • load/update microcode using pkg:
  • load/update intel microcode manually:
    – get latest tgz from intel: see below
    – backup/copy files: /lib/firmware/intel-ucode
    – check kernel config: grep MICROCODE /boot/config-*
    – run iucode_tool:
    /usr/sbin/iucode_tool -tb -lS /lib/firmware/intel-ucode/*
    – update initramfs: update-initramfs -u -k all
  • reloading microcode:
    echo 1 > /sys/devices/system/cpu/microcode/reload
    or: rmmod cpuid; modprobe cpuid
  • show version:
    dmesg | grep microcode or: grep microcode /proc/cpuinfo
  • skip loading microde on boot:
    add to grub cmdline: dis_ucode_ldr


Microsoft includes certain microcode updates in Windows CPU’s. For example: KB4090007, KB3064209, KB2970215.

Get Microcode

Download the latest version from Intel:

Windows IPv6 tunnel
March 28, 2018 — 11:39

Author: silver  Category: network windows  Comments: Off

How to create a 6to4 tunnel in Windows using CLI (for use with HE’s free Tunnel Broker service for example).

netsh interface teredo set state disabled
netsh interface ipv6 add v6v4tunnel TunnelName  
netsh interface ipv6 add address TunnelName 2001:a:b:c::2
netsh interface ipv6 add route ::/0 TunnelName 2001:a:b:c::1


  • “2001:a:b:c::” is your prefix
  • “2001:a:b:c::1” is the gateway
  • “2001:a:b:c::2” is your ipv6 address

Delete the tunnel:

netsh interface ipv6 delete address TunnelName 2001:a:b:c::2
netsh interface ipv6 delete route ::/0 TunnelName 2001:a:b:c::1
netsh interface ipv6 delete interface TunnelName

A HE tunnel can be requested here:

We use Matomo free and open source web analytics (opt-out)