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 perl | |
use strict; | |
use warnings; | |
use 5.010; | |
use Data::Dumper; | |
my $cmdstr = q{/usr/local/bin/ssh %s '/opt/something/bin/somebinary || echo "Could not execute somebinary"' -a -abc --verbose --name="tommy butler" --color="blue" --quote="'to be'" /tmp /foo}; |
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 | |
# skeleton code; you will need to customize to suit | |
# you need to set up your database and install DBIx::Class::Schema::Loader | |
# along with any DBIC components you use below | |
cd /var/projects/My/App | |
dbicdump -o components='["TimeStamp","PassphraseColumn"]' -o dump_directory=./lib My::App::Schema dbi:mysql:dfwpm dfwpm dfwpm '{ AutoCommit => 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
#!/usr/bin/env/ perl | |
use strict; | |
use warnings; | |
use 5.019; | |
use lib './lib'; | |
use My::App::Schema; |
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 | |
# STATUS: proof of concept. TODO: scan syslog as well, with | |
# forward-compatibility for systemd's journalctl syslog also | |
# WARNING: this may have bugs. | |
# CONFIGURE THIS VARIABLE ...based on BIT config file, but here | |
# it is hard coded for rapid prototyping | |
DEPTH=6 |
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
for i in `seq -f "%02g" 0 200`; do dd if=/dev/random of=${i}.test bs=1M count=1; 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
#!/usr/bin/env perl | |
use Modern::Perl; | |
use 5.016; | |
use Expect; | |
use File::Util; | |
use Time::HiRes qw( time ); |
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
BEGIN { # give up root identity and run as an unprivileged user ASAP | |
use POSIX; | |
my $run_as = 'user_you_want_to_run_as'; | |
my ( $uid, $gid ) = ( getpwnam $run_as )[ 2, 3 ]; | |
die $! unless $uid && $gid; |
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 | |
# denyhosts-remove.sh | |
# | |
# AUTHOR: Tommy Butler, email: $ echo YWNlQHRvbW15YnV0bGVyLm1lCg==|base64 -d | |
# VERSION: 1.0 | |
# | |
# SUMMARY: | |
# Use this script to Remove an IP address ban that has been errantly blacklisted | |
# by denyhosts - the ubiquitous and unforgiving brute-force attack protection |
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
# add this to your .bashrc | |
function coretemp { | |
/usr/bin/clear; | |
while : ; do | |
/usr/bin/sensors | /bin/grep ^Core | while read x; do | |
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
shopt -s checkwinsize | |
export PS1="\n[\[\e[1;37m\]\u\[\e[0m\]@\[\e[1;34m\]\H\[\e[0m\]] [\[\e[1;33m\]\d, \t\[\e[0m\]] [\[\e[1;31m\]\!\[\e[0m\]]\n\[\e[1;31m\]\[\e[0m\][\[\e[1;37m\]\w\[\e[0m\]]\n\[\e[1;37m\]\\$\[\e[0m\] " | |
export HISTTIMEFORMAT='%F %T ' | |
export HISTCONTROL=ignoredups | |
export HISTCONTROL=ignoreboth | |
export HISTIGNORE='pwd:ls:history:' | |
export HISTSIZE=4096 | |
export EDITOR='/usr/bin/vim' |
OlderNewer