Skip to content

Instantly share code, notes, and snippets.

@tuksik
tuksik / bind_log.md
Created August 28, 2015 15:09
Problem with /etc/ssl and BIND
Auto configuration failed
3077723872:error:0200100D:system library:fopen:Permission denied:bss_file.c:126:fopen('/usr/lib/ssl/openssl.cnf','rb')
3077723872:error:2006D002:BIO routines:BIO_new_file:system lib:bss_file.c:131:
3077723872:error:0E078002:configuration file routines:DEF_LOAD:system lib:conf_def.c:199:

###Solution: Restore working copy from /etc/ssl

@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:

# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/precise64"
config.vm.hostname = 'FQDN'
# config.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210.box"
config.vm.network "private_network", ip: "192.168.33.23"
config.vm.synced_folder "./bind", "/etc/bind", id: "vagrant-root"
config.vm.usable_port_range = (2200..2250)
@tuksik
tuksik / last_reboot.sh
Created September 16, 2014 09:19
Last reboot
uptime | \
perl -ne '/.*up +(?:(\d+) days?,? +)?(\d+):(\d+),.*/; $total=((($1*24+$2)*60+$3)*60);
$now=time(); $now-=$total; $now=localtime($now); print $now,"\n";'