This file contains hidden or 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 nameserver 8.8.8.8 >> /etc/resolv.conf | |
mkdir .ssh | |
echo ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAp+PYBtN0SlupDT6NxpNSxi97+Z0ETahZXIoeXWoSuiGmeanU/5bf84RE0vhzu494s6hfhgHOOAJL6z2lBr4qNDvdcdv6asNrQjO2r2bnb6W/hogun6usL6D0twujIH60QQqAK8ommRd5X/kSD2vOugShJchfsRMRPWcwkNjJctP5BXJ0kBwP4iylatxro93gMyN6M0Hanbe2UlMkEmwF3qHJTl3EJcQC4rR0VzX1dybpxS+UaX0nV0I5EX6CWSdrg5gqH9GvhbUg7aIHBZqH3ACrrO1betudHKaFKt5wCSaSWqHemBGnYTm0cjKjxIWL2eB7aSaSJJVIy5pC7Aa1dw== [email protected] > .ssh/authorized_keys | |
echo ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAztvVNmwC+KuYQXf6mBIye6cuFzjme3iZEMLWUgoQCGboKfS/5q5c7Liwvu/Wn59BYXDNFY4zs/gyuqJFJ/xvc0lycDE7UGfEbC811Kah3bgPOM6CfHHJRXpVKsb178VImBN8eEwKlf9kZKuvrIP/KaxVbP9O1DAlP48MLYrg5Lc= [email protected] >> .ssh/authorized_keys | |
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm | |
yum -y install vim-enhanced nano mc subversion python26* sysstat nmap nc htop iftop |
This file contains hidden or 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 | |
# turn off some services not needed | |
chkconfig kudzu off | |
chkconfig mcstrans off | |
chkconfig restorecond off | |
chkconfig netfs off | |
chkconfig gpm off |
This file contains hidden or 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 | |
# turn off some services not needed | |
chkconfig kudzu off | |
chkconfig mcstrans off | |
chkconfig restorecond off | |
chkconfig netfs off | |
chkconfig gpm off |
This file contains hidden or 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/python | |
import os | |
import pwd | |
import grp | |
def chown_by_name(path, user, group = None): | |
"""Chowns file based on username and groupname | |
If group name is left blank, group is preserved | |
""" |
This file contains hidden or 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/python | |
""" | |
Use either Nagios env variables or command line args | |
and send jabber message using sendxmpp | |
by GDR! | |
Fill in contact's PAGER to his JID, and add the following command: | |
define command { |
This file contains hidden or 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
from django.forms import widgets | |
from itertools import chain | |
from django.utils.encoding import StrAndUnicode, force_unicode | |
from django.utils.html import escape, conditional_escape | |
from django.utils.safestring import mark_safe | |
class CheckboxSelectMultiple(widgets.SelectMultiple): | |
def render(self, name, value, attrs=None, choices=()): | |
if value is None: value = [] | |
has_id = attrs and 'id' in attrs |
This file contains hidden or 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/python | |
# | |
# Some command in the system being called in mysterious conditions? | |
# Use the logging wrapper! | |
# It will log all calls of a command along with process tree | |
# ("stack trace" of all calling processes) | |
# | |
# Usage: | |
# pip install psutil | |
# mv /usr/bin/snoopedcommand /usr/bin/snoopedcommand_wrapped |
This file contains hidden or 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 | |
# | |
# mass change prefixes in Joomla database | |
# massivescale.net 2012 | |
# | |
echo "SELECT concat('rename table ', table_name, ' to ', 'iddqd', substr(table_name,4), ';') FROM information_schema.tables WHERE table_name like 'jos%';" | mysql | tail -n +2 | mysql `grep db\ /var/www/configuration.php | awk -F"'" '{print $2}'` | |
sed -i -e 's/jos_/iddqd_/' /var/www/configuration.php |
This file contains hidden or 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 | |
# | |
# Add noatime option to fstab for all ext* filesystems | |
# | |
sed -i -r 's/(ext[2-4]\s+)defaults\s/\1defaults,noatime /g' /etc/fstab |
This file contains hidden or 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 ruby | |
# Run me from scripts/ | |
require File.dirname(__FILE__) + "/../config/environment" | |
require 'fcgi_handler' | |
require 'ruby_version_check' | |
require 'initializer' | |
require 'dispatcher' |
OlderNewer