Recent Public Pastes

Reddit praw.ini Configuration
Added by astuffedtiger on 2017-05-16 19:36:09
[reddit]
domain: www.reddit.com
ssl_domain: ssl.reddit.com
user:
pswd:
IP SRC
Added by astuffedtiger on 2017-05-16 19:34:18
until [[ -n `ping -c 1 69.54.26.116 | grep -o ttl.*time` ]] ; do
    /etc/init.d/ipaliases restart 
    sleep 4
done
IP Aliases
Added by astuffedtiger on 2017-05-16 19:33:21
#!/sbin/runscript
depend() {
        need bootmisc
        after net
Reddit Email Notifications
Added by astuffedtiger on 2017-05-16 19:33:21
#!/bin/bash
# Get notifications of new reddit messages by email
MAIL="you@example.com"
# FROMMAIL = mail which will appear in the "from" header of the notifications
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user;killall Finder;echo "Open With has been rebuilt, Finder will relaunch"
Perl Send Mail Script
Added by astuffedtiger on 2017-05-16 19:27:11
#!/usr/bin/perl
use strict;
use Mail::Mailer;
my $mailer = Mail::Mailer->new('smtp', Server => 'smtp.myserver.com');
Copy a website using wget
Added by astuffedtiger on 2017-05-16 19:27:11
#!/bin/bash
wget -erobots=off --no-parent --wait=3 --limit-rate=20K -r -p -U "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" -A htm,html,css,js,json,gif,jpeg,jpg,bmp,png,woff http://pittas.me/envato/html/filoxenia/blue/index.html
Rename cpmove Files with Date
Added by astuffedtiger on 2017-05-16 19:24:46
#!bin/bash
rename .tar.gz -$(date +'%m%d%Y').tar.gz cpmove-*
Username Mentioning in PHP
Added by astuffedtiger on 2017-05-16 19:24:46
<?php
/* From here: http://stackoverflow.com/questions/7671996/how-to-parse-user-mentions-in-php */
$text = 'say hello to @elise_123.com and @john-abc';
function replace_at_symbol($matches){
	$username = str_replace("@", "", $matches[0]);
if ("$h_to:, $h_cc:, $h_bcc" contains "domain.com")
then
    unseen deliver "dd@com.pl"
endif
if $sender_address: contains "domain.com"
Converting MySQL rows/fields
Added by astuffedtiger on 2017-05-16 19:22:37
<?php
/* This script could be used as a template when you need to convert a field value into something else. I used it when converting from MySQL DATATIME to Unix time as well as hashing out new passwords from old ones. */
include('config.php');
DELETE FROM `bb_posts` WHERE `bb_posts`.`post_status` = '2';
DELETE FROM `bb_posts` WHERE `bb_posts`.`post_status` = '1';
Remove Recent OS X 10.8 Userpics.
Added by astuffedtiger on 2017-05-16 19:18:48
#!/bin/bash
#
# This will remove recent pictures which can be selected in Contacts, System Preferences, Messages as your avatar image
#
# Path to folder.
MySQL Selects
Added by astuffedtiger on 2017-05-16 18:45:58
<?php
/* This will easily grab the result from a MySQL row instead of having to go through 3-4 lines of PHP code we can do it in about 2. I like this more. Need to implement across sites. */
$database_host = "";
$database_user = "";
<?php
$gitpull = exec('cd /home/git/git-repository ; /usr/local/bin/git pull origin');
if ($gitpull == "Already up-to-date.") {
    echo "$gitpull - Up to date.";
        exit();