This file contains hidden or 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
<?php | |
function decryptRij($text) { | |
$salt = "my custom key"; | |
return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $salt, base64_decode($text), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))); | |
} | |
function encryptRij($text) { | |
$salt = "my custom key"; | |
return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $salt, $text, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)))); | |
} |
This file contains hidden or 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
<?php | |
function adminer_object() { | |
class AdminerSoftware extends Adminer { | |
function credentials() { | |
# You don't need this if statement, but I added it because not having | |
# it skipped the login screen for everyone. | |
if ($_GET['username'] == 'username') | |
return array('127.0.0.1', 'username', 'password'); | |
} | |
} |
This file contains hidden or 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
import base64 | |
import rijndael | |
KEY_SIZE = 16 | |
BLOCK_SIZE = 32 | |
# I change this value, it needs to be a certain length of 16 or 32 characters in length if i remember correctly. | |
KEY = 'my custom key' |
This file contains hidden or 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
function Decode($strValueIn) { | |
$intX = 0; | |
$intY = 0; | |
$Temp = ""; | |
$Mod = ""; | |
$intMod =0; | |
$intTemp = 0; | |
$ValueOut = ""; | |
$intY = 1; | |
$strValueOut=""; |
This file contains hidden or 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
Sub QuoteCommaExport() | |
' Dimension all variables. | |
Dim DestFile As String | |
Dim FileNum As Integer | |
Dim ColumnCount As Long | |
Dim RowCount As Long | |
' Prompt user for destination file name. | |
DestFile = InputBox("Enter the destination filename" _ | |
& Chr(10) & "(with complete path):", "Quote-Comma Exporter", "C:\temp\") |
This file contains hidden or 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
import os | |
# Open pasted-data.txt file, read the contents. | |
# You could potentially change this to reading the clipboard, and then writing the clipboard with the table. | |
with open('pasted-data.txt', 'r') as text: | |
data = text.readlines() | |
# If the first line is blank, remove it and set blank to True.<br /># If data[0] throws an error, we were passed nothing. Exit. | |
blank = None | |
try: |
This file contains hidden or 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 | |
TIMESTAMP=$(date +"%Y%m%d_%H%M%S") | |
BACKUP_DIR="/home/dev/backups" | |
MYSQL_USER="root" | |
MYSQL=/usr/bin/mysql | |
MYSQL_PASSWORD="password" | |
MYSQLDUMP=/usr/bin/mysqldump | |
mkdir -p "$BACKUP_DIR" |
This file contains hidden or 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
import json | |
from django.contrib.sessions.serializers import BaseJSONSerializer | |
import traceback | |
import datetime | |
class CustomJSONSerializer: | |
""" | |
value type to string format |
This file contains hidden or 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
# This script locks the server, disconnects you from the servers RDP session | |
# sending the session back to console so hamachi does not get disconnected | |
tscon 0 /dest:console | |
tscon 1 /dest:console | |
tscon 2 /dest:console | |
Rundll32.exe User32.dll,LockWorkStation |
This file contains hidden or 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/sh | |
# Delete traffic data leaving X number of months, includes current month | |
# If command line parameter is not provided then default to 1, which keeps current month only | |
if [ $1 -gt 0 ]; then i=$1; else i=1; fi | |
# Get current date in a format compatable with the date -d switch | |
d=`date +%Y.%m.%d-%H:%M` | |
# Loop back through the calendar X number of months | |
# each iteration lands at the last day of the previous month | |
while [ $i -gt 0 ]; do | |
d=$(date -D %s -d $(( $(date -d $d +%s)-( $(date -d $d +%d)*86400))) +%Y.%m.%d-%H:%M) |
OlderNewer