Skip to content

Instantly share code, notes, and snippets.

@tuksik
tuksik / gfm.php
Created February 25, 2013 19:50 — forked from koenpunt/gfm.php
<?php
function gfm($text){
# Extract pre blocks
$extractions = array();
$text = preg_replace_callback('/<pre>.*?<\/pre>/s', function($matches) use (&$extractions){
$match = $matches[0];
$md5 = md5($match);
$extractions[$md5] = $match;
@tuksik
tuksik / README.md
Created April 21, 2013 07:47 — forked from ngauthier/README.md
Installs ruby-2.0.0-p0 on ubuntu
#!/bin/bash
video_dir=~/twitch
if [ $# -ne 1 ]; then
echo "Usage: $0 twitch_video_id"
exit 0
fi
@tuksik
tuksik / 000proxy
Created April 20, 2014 11:23
Apt-proxy
Acquire::http { Proxy "http://10.0.2.2:3142"; };
@tuksik
tuksik / add_org.php
Created April 20, 2014 23:26
Add ORGANIZATION in librarian-puppet-modules
<?php
$file = file('librarian-puppet-modules.txt');
$new_modules = array();
foreach($file as $key=>$row){
$pattern = '%puphpet/.*-%i';
preg_match($pattern, $row, $matches);
$word = str_ireplace('puphpet/','',$matches[0]);
$word = str_ireplace('-','',$word);
$new_row = str_ireplace("mod '","mod '$word/",$row);
$new_modules[] =$new_row;
@tuksik
tuksik / apt.pp
Created April 20, 2014 23:36
Puppet APT settings for the local Apt-Cacher
class { 'apt':
always_apt_update => false,
disable_keys => undef,
proxy_host => '10.0.2.2',
proxy_port => '3142',
purge_sources_list => false,
purge_sources_list_d => false,
purge_preferences_d => false,
update_timeout => undef
}
@tuksik
tuksik / ddns.py
Created May 11, 2014 00:21 — forked from pklaus/ddns.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Written on 2013-02-04 by Philipp Klaus <philipp.l.klaus →AT→ web.de>.
Check <https://gist.github.com/4707775> for newer versions.
A script to update the A and AAAA RRs of HOSTNAME on a DNS server
according to your actual ones using nsupdate / TSIG.
This script is ready to run on Mac OS X (10.8) but you should be able
<?php
/**
* This class can add WSSecurity authentication support to SOAP clients
* implemented with the PHP 5 SOAP extension.
*
* It extends the PHP 5 SOAP client support to add the necessary XML tags to
* the SOAP client requests in order to authenticate on behalf of a given
* user with a given password.
*
@tuksik
tuksik / NewBox.sh
Last active August 29, 2015 14:06
Commands in new Vagrant box
#Keys
mkdir /home/vagrant/.ssh
chmod 700 /home/vagrant/.ssh
cd /home/vagrant/.ssh
wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
chmod 600 /home/vagrant/.ssh/authorized_keys
chown -R vagrant /home/vagrant/.ssh
#Remove udev Rules
rm /etc/udev/rules.d/70-persistent-net.rules
@tuksik
tuksik / remove_ppa.md
Last active August 29, 2015 14:06
Remove a PPA

##PPA

add-apt-repository  ppa:zentyal/3.2
add-apt-repository --remove ppa:zentyal/3.2

Remove a PPA by using ppa-purge in terminal:

You might have noticed that in all the above three methods we only talked about deleting or removing a PPA. What about the applications installed using these PPAs? Will they be removed as a result of removing the PPA? The answer is NO. So this is when PPA purge comes in picture. It not only removes the PPA but also uninstalls all the programs installed by the PPA.

Install ppa-purge by using the following command: