Other
Random commands & scripts & other stuff
Links
SSL
https://www.ssllabs.com/ssltest/
https://www.sslshopper.com/ssl-checker.html
DNS / Domain
https://toolbox.googleapps.com/apps/dig/
https://mxtoolbox.com/NetworkTools.aspx
RBL checks
https://mxtoolbox.com/blacklists.aspx
http://www.anti-abuse.org/multi-rbl-check/
Vulnerability checker
https://www.rapid7.com/db/search
News/Articals
https://www.reddit.com/r/sysadmin/
Tutorials
https://www.unixmen.com/category/linux-tutorials/
https://www.digitalocean.com/community/tutorials
http://www.itzgeek.com/category/how-tos
SSL .htaccess
WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# BEGIN WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Drupal
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Magento
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://mydomain.com/$1 [L,R=301]
No CMS
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
IPMI (SuperMicro)
Update your firmware
ftp://ftp.supermicro.com/utility/IPMI%20FW%20flash%20tools/SMT/
./lUpdate.sh -f SMT_X9_130.bin -i kcs -r n
IPMICFG
Fonction
|
Commande
|
---|---|
Show IP | ipmicfg -m |
Show subnet mask | ipmicfg -k |
Show Gateway | ipmicfg -g |
Check FW | ipmicfg -vgr |
Show VLAN | ipmicfg -vlan |
Set VLAN on | ipmicfg -vlan on #VLAN |
Set VLAN off | ipmicfg -vlan off |
Check IPMI chipset | ipmicfg -selftest |
Set IP Static | ipmicfg -m 10.x.x.x |
Set Subnet | ipmicfg -k 255.255.255.0 |
Set gateway | ipmicfg -g 10.x.x.1 |
Set DHCP off | ipmicfg -dhcp off |
Set DHCP on | ipmicfg -dhcp on |
Check fan mode | ipmicfg -fan |
List users | ipmicfg -user list |
Add user | ipmicfg -user add [user ID] [user name] [password] [privilege] |
Del user | ipmicfg -user del [user id] |
Change user passwd | ipmicfg -user setpwd [user ID] [password] |
Change user pri | ipmicfg -user level [user ID] [privilege] |
Change LAN mode
Check the current mode:
./IPMICFG-Linux.x86_64 -raw 0x30 0x70 0x0c 0
# X9 ATE -raw 0x30 0x70 0x0c 0 X9 AM -raw 0x30 0x70 0x0c 0
The output will be one of these:
0x00 = Dedicated
0x01 = Onboard / Shared
0x02 = Failover
To set the mode to
Dedicated
./IPMICFG-Linux.x86_64 -raw 0x30 0x70 0xc 1 1 0
# X9 ATE -raw 0x30 0x70 0x0c 1 X9 AM -raw 0x30 0x70 0x0c 1 0
./IPMICFG-Linux.x86_64 -raw 0x30 0x70 0xc 1 1 1
# X9 ATE -raw 0x30 0x70 0x0c 1 X9 AM -raw 0x30 0x70 0x0c 1 1
Failover
./IPMICFG-Linux.x86_64 -raw 0x30 0x70 0xc 1 0 0
# X9 ATE -raw 0x30 0x70 0x0c 1 X9 AM -raw 0x30 0x70 0x0c 1 2
IPMIView
ftp://ftp.supermicro.com/utility/IPMIView/
Install java JRE and open 'IPMIView20.jar' with the java bin
IPMITOOL
Set next boot to PXE for next boot
ipmitool -I lanplus -H <ipmi_ip> -U ADMIN -P ADMIN chassis bootdev pxe
Set next boot to DISK for next boot
ipmitool -I lanplus -H <ipmi_ip> -U ADMIN -P ADMIN chassis bootdev disk
Reboot host from IPMI
ipmitool -I lanplus -H <ipmi_ip> -U ADMIN -P ADMIN chassis power cycle
Soft shutdown
ipmitool -H <ipmi_ip> -v -I lanplus -UADMIN -P ADMIN chassis power soft
Find Mac on eth0
ipmitool -I lanplus -U ADMIN -P ADMIN -H <ipmi_ip> raw 0x30 0x21 | tail -c 18
Find FW version
ipmitool -I lanplus -H <ipmi_ip> -U ADMIN -P ADMIN mc info | grep 'Firmware Revision'
Factory reset BMC
ipmitool -I lanplus -H <ipmi_ip> -U ADMIN -P ADMIN raw 0x3c 0x40
Disable Auto Control
ipmitool raw 0x30 0x45 0x1 0x01
Set Fan Speed to not ear cancer
ipmitool raw 0x30 0x70 0x66 0x01 0x00 0x15
Factory reset
ipmitool -I lanplus -H 1.1.1.1 -U ADMIN -P ADMIN raw 0x3c 0x40
Restart
ipmitool -I lanplus -H 1.1.1.1 -U ADMIN -P ADMIN bmc reset cold
Test Drive Performance [Windows / Linux]
Test Sequential Read/Write with DD
Write
dd if=/dev/zero of=./largefile bs=1M count=12288
Read
dd if=./largefile of=/dev/null bs=4k
Test IOPS with FIO
vim test.fio
[random]
rw=randread
size=4g
directory=./iops
iodepth=403
direct=1
blocksize=4k
numjobs=16
nrfiles=1
group_reporting
ioengine=sync
loops=1
rwmixread=75
mkdir ./iops
fio ./test.fio
Test Windows Performance with DiskSpd
Download DiskSpd
https://gallery.technet.microsoft.com/DiskSpd-A-Robust-Storage-6ef84e62
Source code here: https://github.com/microsoft/diskspd
DiskSpd.exe -c150G -d300 -r -w40 -t8 -o32 -b64K -Sh -L D:\SpeedTest\testfile.dat
Parameters:
- -c150G – Create a file of the specified size. Size can be stated in bytes or KiBs, MiBs, GiBs. Here – 150GB.
- -d300 – Duration of measurement period in seconds, not including cool-down or warm-up time (default = 10 seconds). Here – 5 minutes.
- -r – Random I/O access (override -s).
- -s – Sequential I/O access.
- -w40 – Percentage of write requests to issue (default = 0, 100% read). Here 40% of IO operations are Writes, remaining 60% are Reads. This is a usual load for my SQL Server OLTP databases.
- -t8 – The number of threads per file. Here – 8. One thread per available core.
- -o32 – The number of outstanding I/O requests per target per thread. In other words, it is a queue depth. Here – 32.
- -b46K – Block size in bytes or KiBs, MiBs, or GiBs. Here – 64KB.
- -Sh – Disable both software caching and hardware write caching.
- -L – Measure latency statistics.
- D:\SpeedTest\testfile.dat – My target file used for testing (created with -c).