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
Command used for testing: | |
dd if=/dev/zero of=sb-io-test bs=1M count=1k conv=fdatasync && rm sb-io-test | |
Results sorted by best->top / worst->bottom | |
Herzner (1 cpu cloud machine) | |
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.23958 s, 866 MB/s | |
OVH Dedicated VmWare nVME | |
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.24378 s, 863 MB/s |
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
# Still a work in progress but is good enough for development | |
# | |
# `rake redmine:demo_data` for it all | |
# `rake redmine:demo_data:users` | |
# `rake redmine:demo_data:projects` | |
# `rake redmine:demo_data:issues` | |
# `rake redmine:demo_data:time_entries` | |
require "faker" | |
require "random_data" |
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 | |
# this script will install fail2ban and enable apache-wp-login rule | |
# you will notice once it's done that fail2ban-client status shows apache-wp-login rule as active | |
apt install fail2ban | |
JAIL='' | |
JAIL="${JAIL}\n" | |
JAIL="${JAIL}[apache-wp-login]\n" | |
JAIL="${JAIL}enabled = true\n" | |
JAIL="${JAIL}port = http,https\n" | |
JAIL="${JAIL}filter = apache-wp-login\n" |
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 | |
#this script is intended to decrapify your Ubuntu, stuff like turn off unattended upgrades... | |
echo 'some of this should be done as root' | |
echo 'Fix keyboard shortcuts' | |
gsettings set org.gnome.desktop.input-sources xkb-options [] #remove left ctrl shift | |
gsettings set org.gnome.mutter overlay-key 'Super_L' | |
gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ new-tab '<Control><Shift>t' | |
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 | |
echo 1 > /sys/block/sda/device/rescan | |
cfdisk /dev/sda | |
pvresize /dev/sda3 | |
lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv | |
resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv |
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 | |
wget -qO- http://acosonic.com/ip.php && echo -e "\r" | |
#you can use shc and compile this like shc -vrf pubip.sh -o pubip && mv pubip ~/bin | |
#then just use it as pubip from anywhere or move to system bin... |
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
TRUNCATE TABLE `db`.`table`; | |
LOAD DATA LOCAL INFILE '/home/ubuntu/file.csv' IGNORE INTO TABLE `db`.`table` | |
FIELDS TERMINATED BY ',' | |
OPTIONALLY ENCLOSED BY '"' ESCAPED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES (`id`, `Name`, | |
`Status`, `AccountNumber`, @v1, | |
@v2, `Business_Street`) | |
SET Formation_Date = STR_TO_DATE(@v1,'%m/%d/%Y'), | |
Production_Date = STR_TO_DATE(@v2,'%m/%d/%Y'); |
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 | |
apt install memcached libmemcached-tools | |
systemctl status memcached | |
echo stats | nc 127.0.0.1 11211 | |
apt install php-memcached | |
phpenmod memcached | |
apache2ctl restart |
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 | |
LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' | | |
while read pkg revision; do | |
sudo snap remove "$pkg" --revision="$revision" | |
done |
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
#change the exit criteria 61564999 to fit your needs | |
CREATE DEFINER=`root`@`localhost` PROCEDURE `adduuid`() | |
LANGUAGE SQL | |
NOT DETERMINISTIC | |
CONTAINS SQL | |
SQL SECURITY DEFINER | |
COMMENT '' | |
BEGIN | |
DECLARE a INT Default 1 ; | |
simple_loop: LOOP |
NewerOlder