Go to ...

Techpository

A Better Technical Repository

RSS Feed

Techpository

Welcome to Techpository.  This is a personal repository of helpful information.  Content on this site is both self-created and copied from other resources.  We try to make sure we give credit where credit is due.  Use the information on this site at your own risk.

View More ››
Linux

Linux: Using grep

Word count grep -o ‘word’ filename | wc -l One liner to find a running process and kill it kill $(ps aux |grep -i ‘[/]usr/bin/puppet’ | awk ‘{print $2}’) Find duplicate words in a file grep -wo ‘[[:alnum:][:punct:]]+’ filename.txt | sort | uniq -cd You may need to vary the “bracket expressions”, to fit the

View More ››
Linux

Linux: NIC Bonding Examples

The following example creates to Bonds. Bond0 is Active-Backup Bond1 uses VLAN tagging and LACP Kernel setup: modprobe kernel configuration /etc/modprobe.d/bonding1.conf alias netdev-bond1 bonding options bond1 miimon=100 mode=4 lacp_rate=1 Bond0: ifcfg-bond0 DEVICE=bond0 IPADDR=172.16.0.3 NETMASK=255.255.255.0 NETWORK=172.16.0.0 BROADCAST=172.16.0.255 ONBOOT=yes BOOTPROTO=none TYPE=Bond BONDING_MASTER=yes PREFIX=24 DEFROUTE=yes NAME=”Bond bond0″ BONDING_OPTS=”mode=active-backup miimon=0 arp_ip_target=172.16.0.1 arp_interval=1000″ LAST_CONNECT=1530826407 NM_CONTROLLED=no ifcfg-bond0_slave_1 DEVICE=em1 TYPE=Ethernet NAME=”System em1″

Linux

Linux: Finding HBAs driver version and wwpn

Pull Driver Version: # modinfo qla2xxx | grep version version: 9.00.00.00.40.0-k1 srcversion: 67989F13670BACC60C8CA47 vermagic: 4.1.12-124.17.1.el6uek.x86_64 SMP mod_unload modversions Pull WWPN: # more /sys/class/fc_host/host?/port_name :::::::::::::: /sys/class/fc_host/host1/port_name :::::::::::::: 0x2001000e1e024d24 :::::::::::::: /sys/class/fc_host/host2/port_name :::::::::::::: 0x2001000e1e024d7d

Linux

Linux: Raspberry PI – Chromium didn’t shut down correctly – How to fix

When using Chromium as a Kiosk it will not shutdown properly on reboot.  As a result it throws an error every time it restarts. Here is my fix(This assumes you are using pi as your auto login user): 1. mkdir /home/pi/scripts 2. nano /home/pi/scripts/chromiumcleanup 3. Add the following: #!/bin/bash /bin/sed -i ‘s/”exit_type”:”Crashed”/”exit_type”:”Normal”/’ ~/.config/chromium/Default/Preferences 4. ctrl

View More ››