Storcli for Avago/LSI Raid controllers

sudo apt-get install alien

jjest@backupsrv:~$ alien /data/software/StoreCLI/storcli_all_os/Linux/storcli-1.19.04-1.noarch.rpm
Must run as root to convert to deb format (or you may use fakeroot).
jjest@backupsrv:~$ sudo alien /data/software/StoreCLI/storcli_all_os/Linux/storcli-1.19.04-1.noarch.rpm
Warning: Skipping conversion of scripts in package storcli: postinst postrm prerm
Warning: Use the –scripts parameter to include the scripts.
storcli_1.19.04-2_all.deb generated
jjest@backupsrv:~$ sudo dpkg -i storcli_1.19.04-2_all.deb
Selecting previously unselected package storcli.
(Reading database … 216694 files and directories currently installed.)
Preparing to unpack storcli_1.19.04-2_all.deb …
Unpacking storcli (1.19.04-2) …
Setting up storcli (1.19.04-2) …
jjest@backupsrv:~$ sudo ./check-array-status.sh
Disk all good!
jjest@backupsrv:~$ cat ./check-array-status.sh
#!/bin/bash
out=$(/opt/MegaRAID/storcli/storcli64 /c0 show all | grep -e ^252 | grep -v Onln)
lines=$(echo $out | wc -l);
if [[ -z “$lines” ]]; then
if [[ $lines -gt 2 || $lines -eq 2 ]]; then
echo $out
else
OK=1
fi
else
OK=1
fi

if [ $OK == “1” ]; then
echo “Disk all good!”
fi

Vsftpd: User unable to login.

Vsftpd: User unable to login.

Thu May 18 22:37:47 2017 [pid 6851] [reolink] FAIL LOGIN: Client “::ffff:192.168.0.120”
Thu May 18 22:37:51 2017 [pid 6860] CONNECT: Client “::ffff:192.168.0.118”
Thu May 18 22:37:53 2017 [pid 6859] [reolink] FAIL LOGIN: Client “::ffff:192.168.0.118”
Thu May 18 22:38:01 2017 [pid 6883] CONNECT: Client “::ffff:192.168.0.118”
Thu May 18 22:38:03 2017 [pid 6882] [reolink] FAIL LOGIN: Client “::ffff:192.168.0.118”

User must have valid shell.

reolink:x:1001:1001::/home/reolink:

Add /bin/bash

reolink:x:1001:1001::/home/reolink:/bin/bash

Done!

Samba: Can’t add new user

root@donkey:~# smbpasswd -a lukie
New SMB password:
Retype new SMB password:
Failed to add entry for user lukie.

root@donkey:~# echo $?
1

#NEED TO CREATE OS USER FIRST. TIED TOGETHER.
root@donkey:~# sudo useradd lukie

root@donkey:~# smbpasswd -a lukie
New SMB password:
Retype new SMB password:
Added user lukie.

#WORKS!

Ubuntu Single User Mode…I always forget

Atlantic.Net Cloud – How to enter single user mode for Ubuntu Atlantic.net Cloud servers

Duckdns Host Update Script.

jjest@jjest-pi3:~$ cat ./duckdns.sh
#!/bin/bash
mail_to=email@gmail.com
dns_host=”host.duckdns.org”
ip=$(curl https://wtfismyip.com/text 1>&2)
token=”xxxxxxxxxxxxxxxxxxxxxxxxx”
url=”https://www.duckdns.org/update?domains=${dns_host}&token=${token}&ip=$ip&verbose=true”
curl $url > out
out=$(grep -i “NOCHANGE” out)
if [[ $out != “NOCHANGE” ]]; then
msg=”DNS updated: $dns_host”
echo $msg
echo “DNS updated!” | mail -s “$msg” $mail_to
else
echo “DNS no change”
fi

PGP How To

jjest@canadark ~ $ pgp -e test.txt jjest

jjest@canadark ~ $ cat test.txt
jkjlk

jjest@canadark ~ $ cat test.txt.pgp
�
�wb�
Y��ⴳ����4sn����E4?�vr��ĻbO’�I’�sI�O6v�;��/bk?�#<ا��^�N�(�ϏK��O;\����`o�W>+ШF��s���R��I�yg7�w���d�5x�Kf����?o�s`�SY=��4���4�B
*�����NJeC��l�=ɩ��TxG}P<��\́���*������o�#m�����ET^�m��|� ��VsP�,g�^��ݓN�G���n��0�P���ѳ���tu�I�����+�l#"T��HcT������U0>ND�G�X����qV�5�[���c
�D��ت:��[��ӊ
�zH{��

jjest@canadark ~ $ scp .gnupg/pubring.gpg jjest@donkeyrobot.duckdns.org:~
jjest@donkeyrobot.duckdns.org’s password:
pubring.gpg 100% 1178 1.2KB/s 00:00

jjest@canadark ~ $ scp test.txt.pgp jjest@donkeyrobot.duckdns.org:~
jjest@donkeyrobot.duckdns.org’s password:
test.txt.pgp 100% 346 0.3KB/s 00:00

Generate pub key in plain text.

jjest@canadark ~ $ gpg –armor –export > pub.asc
jjest@canadark ~ $ cat pub.asc
—–BEGIN PGP PUBLIC KEY BLOCK—–
Version: GnuPG v1.4.11 (GNU/Linux)

mQENBFkA4QcBCACivyRC+xf93KFiPekRrTki0RpF2dFqdO26qDXnPbJ3/eHwxxe2
jRGwS+t/OEpKFJVgr2uewyYKlICKB8td/45hVREiYBODn/0RUm7xF1gRzkrrOeeE
EBM5q3w9SZgQCAWYCkDAzgrPpxpqiU9r5T9lpSTEJRO3VHShtlKhl/Ritz0XKhjy
j80GVyh4Wl2/lIcqpsTA/xWDYGUMBwDQNdPMXdAt+4+/4YI8v94kVydJWnfS6p+C
j1khbOjGJr0DpZUTLVYnJg/zPcUIj4ikEF0GedB8TPKTPorvwLoc41RLfpLczte+
dxlpRv8dLODbAxLtB5t22ON5wCpcyqpKPjQTABEBAAG0FGpqZXN0IDxqamVzdEB1
dy5lZHU+iQE3BBMBAgAiBQJZAOEHAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIX
gAAKCRAA7w2ecvmVbdOQB/dSvlRqo3Eenbk6Ri+aSrHs1qeNTqL5S57+HEN0sCOy
T4dr9OHb9HSnP4o+xrwF7TmAgRtXpdWn40ggYWI02f+fefzNrsSyeGfkjU+ohVZj
5vRPMlgeXJA7hdMWF9kve6w6Jrbw2y8HbbWCfcVwLQSGy/bslyfj39H046MyDU69
w6NdwHioi382Sbzet3+qF345/WBOzNgQzaa/M/39qj+ckm3skJMDx6xljAERAoFB
x7sM53q20wnAf/2yWglGesYe0hlRItk4eJt/sgzQ2Hx787wCJuVl+h56MmBc/f9x
uI1LdN1bJ5Fse6TJEpgIvdKePfLtpOn1jfj465q8Uwu5AQ0EWQDhBwEIANcL0V0b
bX91bOyoBwn9j4BhCAQtHPFOJm/hk7zVYYCcAcRfAMMcsNBUdVXFjAP37mFjCmgm
mlhC9WWI1+QVsyya40YbuB86HMFiNPJwDtDWZ52JPVPzT3KH9nHFP+gHF+i36dFN
P……..
—–END PGP PUBLIC KEY BLOCK—–

Generate private key for client as well.

$ gpg –export-secret-keys > key.asc

Xfer pub key to client.

jest@canadark ~ $ scp pub.asc key.asc donkeyrobot.duckdns.org:~
jjest@donkeyrobot.duckdns.org’s password:
pub.asc

can also do this (not tested)

gpg –keyserver search.keyserver.net –send-key you@example.com

Import pub key to client.

jjest@donkey:~$ gpg –import pub.asc
gpg: key 72F9956D: public key “jjest” imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)

jjest@donkey:~$ gpg –import key.asc
gpg: key 72F9956D: secret key imported
gpg: key 72F9956D: “jjest” not changed
gpg: Total number processed: 1
gpg: unchanged: 1
gpg: secret keys read: 1
gpg: secret keys imported: 1

list keys

jjest@donkey:~$ gpg –list-keys
/home/jjest/.gnupg/pubring.gpg
——————————
pub 2048R/72F9956D 2017-04-26
uid jjest
sub 2048R/F50C59D3 2017-04-26

Decrypt & unpack file

jjest@donkey:~$ gpg test.txt.pgp
gpg: encrypted with 2048-bit RSA key, ID F50C59D3, created 2017-04-

jjest@donkey:~$ cat test.txt
jkjlk

Comcast vs Century Link (Seattle)

jjest@jjest-pi3:~$ speedtest-cli
Retrieving speedtest.net configuration…
Retrieving speedtest.net server list…
Testing from XFINITY (73.169.165.149)…
Selecting best server based on latency…
Hosted by SoftLayer Technologies, Inc. (Seattle, WA) [16.78 km]: 90.226 ms
Testing download speed………………………………….
Download: 66.17 Mbit/s
Testing upload speed…………………………………………..
Upload: 1.60 Mbit/s

Century Link Gigabit @ House

jjest@donkey:~$ speedtest-cli
Retrieving speedtest.net configuration…
Retrieving speedtest.net server list…
Testing from CenturyLink (174.24.231.76)…
Selecting best server based on latency…
Hosted by CenturyLink, Inc (Seattle, WA) [2.10 km]: 9.499 ms
Testing download speed………………………………….
Download: 646.79 Mbit/s
Testing upload speed…………………………………………..
Upload: 243.64 Mbit/s