This file contains 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 time_elapsed_string($ptime) { | |
$etime = time() - $ptime; | |
if($etime < 1) { | |
return '0 seconds'; | |
} | |
$a = array( | |
12 * 30 * 24 * 60 * 60 => 'year', | |
30 * 24 * 60 * 60 => 'month', |
This file contains 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 | |
require_once("config.php"); | |
$mysql = mysqli_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB); | |
function callInstagram($url) { | |
$ch = curl_init(); | |
curl_setopt_array($ch, array( | |
CURLOPT_URL => $url, | |
CURLOPT_RETURNTRANSFER => true, |
This file contains 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 | |
$target = "path"; | |
$link = "path"; | |
symlink($target, $link); | |
echo readlink($link); | |
?> |
This file contains 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
#!/usr/bin/perl | |
use Net::LDAP; | |
$ldap = Net::LDAP->new( 'mike.wisedevelop.org', port => 389 ) or die "$@"; | |
$mesg = $ldap->start_tls( cafile => 'ssl/mike.cert.pem', capath => 'ssl/' ); | |
$mesg = $ldap->bind ; |
This file contains 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
#!/usr/bin/perl | |
use DateTime; | |
use Net::LDAP; | |
$DN="ou=People,dc=wisedevelop,dc=org"; | |
$HOST="mike.wisedevelop.org"; | |
sub generate_random_string | |
{ | |
my $length_of_randomstring=shift;# the length of |
This file contains 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
#!/usr/bin/env ruby | |
MODE = 2 # Modes 1: set boot record; 2: Remove boot record | |
RECORD = 1 # Record 1: Windows; 2: Linux; 3: Image Cast; 4: Image Recive | |
BASE_ADDRESS = "143.60" | |
VLAN = "74" | |
START_IP = "1" | |
END_IP = "255" |
This file contains 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
#include <LiquidCrystal.h> | |
#include <SD.h> | |
#include <Keypad.h> | |
#include <Servo.h> | |
const int chipSelect = 53; // SD pin | |
const char gpsTag[] = "$GPRMC"; // Start of GPS command | |
LiquidCrystal lcd(2, 3, 4, 5, 6, 7); |
This file contains 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
#include <SoftwareSerial.h> | |
SoftwareSerial rfid(9,11); | |
SoftwareSerial wire(2,3); | |
int SerialResetPIN = 6; | |
int SerialSleepPIN = 7; | |
int RFIDResetPin = 10; | |
void setup() { |
This file contains 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 | |
apt-get install -y sudo build-essential vim zlib1g-dev | |
/usr/sbin/groupadd wheel | |
/usr/sbin/usermod -a -G wheel jacob | |
chmod +w /etc/sudoers | |
echo "%wheel All=(ALL) ALL" >> /etc | |
chmod -w /etc/sudoers |
This file contains 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
*filter | |
# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0 | |
-A INPUT -i lo -j ACCEPT | |
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT | |
# Accepts all established inbound connections | |
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT |