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
grep "^MimeType=" /usr/share/applications/vlc.desktop | \ | |
cut -d "=" -f 2 | \ | |
xargs -d ';' -n 1 | \ | |
grep -e "^video/" -e "^x-content/video" | \ | |
xargs -n 1 -I '{}' \ | |
xdg-mime default vlc.desktop '{}' |
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
sed -i \ | |
-e 's@PS_EMAIL_ALERT = "1"@PS_EMAIL_ALERT = "0"@' \ | |
-e 's@LF_EMAIL_ALERT = "1"@LF_EMAIL_ALERT = "0"@' \ | |
-e 's@CT_EMAIL_ALERT = "1"@CT_EMAIL_ALERT = "0"@' \ | |
-e 's@LF_PERMBLOCK_ALERT = "1"@LF_PERMBLOCK_ALERT = "0"@' /etc/csf/csf.conf |
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
# 1 rsync connection | |
cat << EOF > /etc/csf/csfpre.sh | |
iptables -A INPUT -p tcp --syn --dport 873 -m connlimit --connlimit-above 1 -j REJECT | |
EOF | |
# 4 HTTP connection | |
cat << EOF > /etc/csf/csfpre.sh | |
iptables -A INPUT -p tcp --syn --dport 80 -m connlimit --connlimit-above 4 -j REJECT | |
EOF |
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 | |
TARGET="~/temp" | |
listvms=`VBoxManage list runningvms | awk '{ print $2 }'` | |
IFS=$(echo -en "\n\b") | |
for vm in $listvms | |
do | |
date=`date +"%Y%m%d-%N"` | |
VBoxManage controlvm $vm screenshotpng $TARGET/$date.png | |
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
rabbitmqctl add_user fred changeme | |
rabbitmqctl set_user_tags fred administrator | |
rabbitmqctl set_permissions fred ".*" ".*" ".*" |
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 program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
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
SERVER=foreman | |
cat > /etc/apt/sources.list.d/puppetlabs.list << EOF | |
deb http://apt.puppetlabs.com trusty main | |
deb-src http://apt.puppetlabs.com trusty main | |
deb http://apt.puppetlabs.com trusty dependencies | |
deb-src http://apt.puppetlabs.com trusty main dependencies | |
EOF | |
apt-get update |
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 | |
# Apply hostname from DNS server | |
# Author : F-Gaudet 2014 | |
# Usage : drop this file into /etc/NetworkManager/dispatcher.d | |
interface=$1 status=$2 | |
if [ $status = up ]; then | |
ip=$(ip addr | grep $interface: -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/' ) | |
string=$(host $ip) > /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
#!/usr/bin/env python | |
# coding=utf-8 | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
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
#!/usr/bin/env python | |
# coding=utf-8 | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
OlderNewer