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
# http://prowiki.isc.upenn.edu/wiki/TCP_tuning_for_broken_firewalls | |
echo 0 | sudo tee /proc/sys/net/ipv4/tcp_timestamps | |
echo 0 | sudo tee /proc/sys/net/ipv4/tcp_window_scaling | |
# or add to sysctl.conf: | |
# net.ipv4.tcp_window_scaling=0 | |
# net.ipv4.tcp_timestamps=0 |
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 | |
dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve $kernelver |xargs sudo apt-get purge -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
# Activate Plug-Up Security Key by creating: /etc/udev/rules.d/90-u2f-securitykey.rules anlegt | |
# (as root): | |
ATTRS{idVendor}=="2581", ATTRS{idProduct}=="f1d0", TAG+="uaccess" | |
ATTRS{idVendor}=="2581", ATTRS{idProduct}=="f1d0", GROUP="plugdev", MODE="0660" |
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
/etc/security/limits.conf: | |
* soft nproc 65535 | |
* hard nproc 65535 | |
* soft nofile 65535 | |
* hard nofile 65535 | |
sysctl.conf: | |
fs.file-max = 65536 |
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
ACTION!="add|change", GOTO="u2f_end" | |
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1050", ATTRS{idProduct}=="0113|0114|0115|0116|0120|0402|0403|0406|0407|0410", TAG+="uaccess" | |
LABEL="u2f_end" |
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 | |
namespace ElasticFind; | |
use Pimcore\API\Plugin as PluginLib; | |
class Plugin extends PluginLib\AbstractPlugin implements PluginLib\PluginInterface { | |
public function init() { |
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 | |
OLD=$(ls -tr /boot/vmlinuz-* | head -n -3 | cut -d- -f2- | | |
awk '{print "linux-image-" $0 " linux-headers-" $0}' ) | |
echo "OLD:" | |
echo "$OLD" | |
echo | |
echo -n "CURRENT: " | |
uname -r |
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 | |
# see: http://unix.stackexchange.com/questions/117093/find-where-inodes-are-being-used | |
# show inode usage: | |
df -i | |
# find where all those files are (roughly) - starts at / | |
find / -xdev -printf '%h\n' | sort | uniq -c | sort -k 1 -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
# BASH: resize/crop via ImageMagick | |
#================================== | |
function resizecrop { | |
SIZE=$1 | |
SRC=$2 | |
DST_PATH=$3 | |
SRC_NAME=`basename $SRC` | |
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 | |
// detect single/quoted string (w/ escapes) within strings ..: | |
$regexp = '/(["\\\'])(?:\\\\?+.)*?\1/'; | |
$testStr = " foo \"b\\\"ar\" baz '0\"8\"15' bing"; | |
preg_match_all($regexp,$testStr,$matches); | |
print_r($matches); |
OlderNewer