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 | |
# First run | |
rsync -aHAXxv --numeric-ids --no-compress --inplace -W --delete --progress \ | |
-e "ssh -T -c aes128-ctr -o Compression=no -x" \ | |
server1:/dir/ /dir/ | |
# Second run | |
rsync -av --numeric-ids --no-compress --delete --progress \ | |
-e "ssh -T -c aes128-ctr -o Compression=no -x" \ |
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 | |
sudo usb_modeswitch -W -v 12d1 -p 1f1e -J > /dev/null |
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 | |
openssl req -x509 -nodes -days 3650 -subj "/C=CZ/ST=CZ/O=Application/CN=app.test" -addext "subjectAltName=DNS:app.test" -newkey rsa:2048 -keyout app.key -out app.crt |
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
CREATE TABLE `dns_record` ( | |
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, | |
`origin` varchar(63) COLLATE utf8_bin NOT NULL, | |
`name` varchar(255) COLLATE utf8_bin NOT NULL, | |
`type` char(6) COLLATE utf8_bin NOT NULL, | |
`value` text COLLATE utf8_bin NOT NULL, | |
PRIMARY KEY (`id`), | |
KEY `origin` (`origin`), | |
KEY `type` (`type`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_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
/ip firewall filter | |
add action=drop chain=output comment="drop pings to 8.8.8.8 if they go through LTE" \ | |
dst-address=8.8.8.8 out-interface=lte1 protocol=icmp | |
/ip firewall nat | |
add action=masquerade chain=srcnat src-address=192.168.1.0/24 comment=ISP1 | |
add action=masquerade chain=srcnat src-address=192.168.1.0/24 out-interface=lte1 disabled=yes comment=LTE | |
/system script | |
add name=ISP1up owner=admin policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\ |
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
<?php declare(strict_types=1); | |
namespace App\Presenters; | |
use Kdyby\Translation\Translator; | |
use Nette\Application\Helpers; | |
use Nette\Application\UI\Presenter; | |
abstract class BasePresenter extends Presenter | |
{ |
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
<?php declare(strict_types=1); | |
final class Passwords | |
{ | |
private const OLD_SALT = 'xxx'; | |
public const PS_OLD = 'prestashop_old'; | |
public const PS_HASHED = 'prestashop_hashed'; | |
public const BCRYPT = 'bcrypt'; |
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 | |
current_version=$(uname -r | sed 's/-generic\|-virtual//') | |
kernels=$(dpkg -l | grep 'linux-image-[0-9]' | awk '{print $2}') | |
latest_kernel=$(echo $kernels | tr ' ' '\n' | tail -1) | |
remove_kernels=$(echo $kernels | tr ' ' '\n' | grep -v $latest_kernel | grep -v $current_version) | |
headers=$(dpkg -l | grep 'linux-headers-[0-9]' | awk '{print $2}') | |
latest_headers=$(echo $headers | tr ' ' '\n' | tail -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
#!/bin/bash | |
echo "$(hostname) SSHFP 1 2 $(cut -f2 -d ' ' "/etc/ssh/ssh_host_rsa_key.pub" | base64 --decode | sha256sum | cut -f 1 -d ' ')" | |
echo "$(hostname) SSHFP 4 2 $(cut -f2 -d ' ' "/etc/ssh/ssh_host_ed25519_key.pub" | base64 --decode | sha256sum | cut -f 1 -d ' ')" |
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
$TTL 3600 | |
@ IN SOA ns.sunfox.cz. sunfox.sunfox.cz. ( | |
2016010902 ; serial, todays date + todays serial # | |
7200 ; refresh, seconds | |
540 ; retry, seconds | |
604800 ; expire, seconds | |
86400 ) ; minimum, seconds | |
; | |
2.0.0.0.0.0.6.c.2.0.a.2.ip6.arpa. 3600 NS ns.sunfox.cz. |
NewerOlder