This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A QA engineer walks into a bar, and orders a beer. | |
Then he orders 0 beers. | |
Then he orders 999999999999 beers. | |
Then he orders an aardvark. | |
Then he orders nothing. | |
Then he orders -1 beers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Delete older than n days | |
find /var/spool/asterisk/monitor -mtime +75 -name '*.mp3' -delete | |
#Delete files smaller than n K | |
find /var/spool/asterisk/monitor -size -30k -name '*.mp3' -delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' DESCRIPTION: | |
' This script will backup bitlocker recovery information to active directory for drives which are already encrypted. | |
' DEVELOPED BY: | |
' Himanshu Singh ([email protected]) | |
' Microsoft Corporation | |
' Patched by Evgeny Varnavskiy | |
' Sep 2018 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout master | |
git merge --squash devel | |
git commit | |
git branch -f devel master | |
git push --all -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ping -c4 192.168.1.1 > /dev/null | |
if [ $? != 0 ] | |
then | |
d=`date` | |
echo "$d No network connection, restarting wlan0" >> /var/log/wifimon.txt | |
ifconfig wlan0 down | |
sleep 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://code.luasoftware.com/tutorials/linux/command-line-optimize-image/ | |
find . -type f -iname '*.png' -exec pngquant --skip-if-larger --ext .png --force 256 {} \; | |
find . -type f -iname "*.png" | xargs optipng -o2 -strip all | |
find . -name '*.png' -print0 | xargs -0 -n1 -I{} sh -c 'zopflipng {} output.png; [ -f output.png ] && mv output.png {};' | |
# Using -print0 to deal with spaces | |
find . -print0 -type f -name "*.jpg" -o -name "*.JPG" | xargs -0 jpegoptim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Get curl {{curlver}} packages | |
get_url: url={{ item }} dest=/tmp/ | |
with_items: | |
- https://mirror.city-fan.org/ftp/contrib/sysutils/Mirroring/curl-{{ curlver }}-2.0.cf.rhel7.x86_64.rpm | |
- https://mirror.city-fan.org/ftp/contrib/sysutils/Mirroring/libcurl-{{ curlver }}-2.0.cf.rhel7.x86_64.rpm | |
- https://mirror.city-fan.org/ftp/contrib/libraries/libmetalink-0.1.3-9.rhel7.x86_64.rpm | |
- https://mirror.city-fan.org/ftp/contrib/libraries/c-ares-1.15.0-4.0.cf.rhel7.x86_64.rpm | |
- https://mirror.city-fan.org/ftp/contrib/libraries/libssh2-1.9.0-3.0.cf.rhel7.x86_64.rpm | |
- https://mirror.city-fan.org/ftp/contrib/libraries/libidn-1.34-3.0.el7.x86_64.rpm | |
tags: curl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
XZ_OPT="--threads=4" nohup find . -maxdepth 1 -type d -mtime +1000 -exec tar --remove-files -cJf {}.tar.xz {} \; & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Misc: | |
apt install mc fail2ban htop openvpn git iotop lsof | |
Add to /etc/sysctl.d/70-bufferbloat.conf | |
net.core.default_qdisc=fq | |
net.ipv4.tcp_fastopen=3 | |
net.ipv4.tcp_ecn=1 | |
net.ipv4.tcp_sack=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOG_FILE=/root/installer.log | |
exec > >(tee -a ${LOG_FILE} ) | |
exec 2> >(tee -a ${LOG_FILE} >&2) |