Skip to content

Instantly share code, notes, and snippets.

@kyrannian
kyrannian / gist:42911ae698b265182469
Created July 25, 2014 00:41
Hastebin PHP Client
function paste_to_hastebin($data) {
$ch = curl_init();
$url = "http://192.168.20.160:7777";
curl_setopt($ch, CURLOPT_URL, $url . "/documents");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$output = curl_exec($ch);
curl_close($ch);
@kyrannian
kyrannian / gist:7111444
Created October 23, 2013 02:06
add-apt-repository for debian
#!/bin/bash
if [ $# -eq 1 ]
NM=`uname -a && date`
NAME=`echo $NM | md5sum | cut -f1 -d" "`
then
ppa_name=`echo "$1" | cut -d":" -f2 -s`
if [ -z "$ppa_name" ]
then
echo "PPA name not found"
echo "Utility to add PPA repositories in your debian machine"