Skip to content

Instantly share code, notes, and snippets.

View podarok's full-sized avatar
🏠
Working from home

Andrii Podanenko podarok

🏠
Working from home
View GitHub Profile
@insdavm
insdavm / WireGuard-site-to-site.md
Last active May 3, 2024 21:19
Accessing a subnet that is behind a WireGuard client using a site-to-site setup

WireGuard Site-to-Site

Accessing a subnet that is behind a WireGuard client using a site-to-site setup

Problem Summary

We want to access a local subnet remotely, but it is behind a NAT firewall and we can't setup port forwarding. Outgoing connections work, but all incoming connections get DROPPED by the ISP's routing policy.

Solution Summary

@rhuancarlos
rhuancarlos / sources.list
Created October 5, 2018 03:22
Ubuntu 18.04 Bionic default /etc/apt/sources.list
#deb cdrom:[Ubuntu 18.04 LTS _Bionic Beaver_ - Release amd64 (20180426)]/ bionic main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted

RTAI installation for ubuntu 14.04

Preparation

Switch user mode

sudo su

download and unzip

@gaoyifan
gaoyifan / RTAI installation for ubuntu 14.04.md
Last active March 17, 2019 10:31
RTAI installation for ubuntu 14.04

RTAI installation for ubuntu 14.04

Preparation

download and unzip

cd /usr/src
curl -L https://www.rtai.org/userfiles/downloads/RTAI/rtai-4.1.tar.bz2 | tar xj
curl -L https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.10.32.tar.xz | tar xJ
curl -L http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10.32-saucy/linux-image-3.10.32-031032-generic_3.10.32-031032.201402221635_amd64.deb -o linux-image-3.10.32-generic-amd64.deb
### ElasticSearch version
if [ -z "$1" ]; then
echo ""
echo " Please specify the Elasticsearch version you want to install!"
echo ""
echo " $ $0 1.4.0"
echo ""
exit 1
fi
@ThomasHambach
ThomasHambach / marker.js
Created January 26, 2014 08:08
Drupal 7 GMAP multi language bubble fix
// Search for this line (on line 92 for me)
if (obj.vars.rmtcallback) {
uri = Drupal.settings.basePath + obj.vars.rmtcallback + '/' + marker.rmt;
}
// And change it to
if (obj.vars.rmtcallback) {
uri = Drupal.settings.basePath + Drupal.settings.pathPrefix + obj.vars.rmtcallback + '/' + marker.rmt;
}
sudo apt-get install pgbouncer
# edit /etc/pgbouncer/pgbouncer.ini file
# edit /etc/default/pgbouncer file and set START=1
sudo service pgbouncer start
contents of /etc/pgbouncer/pgbouncer.ini file
[databases]
drupal = host=127.0.0.1 port=5432 dbname=drupal
1) install drupal & apache
wget http://ftp.drupal.org/files/projects/drupal-7.12.tar.gz
tar zxvf drupal-7.12.tar.gz
sudo apt-get install apache2 php5-pgsql php5-gd libapache2-mod-php5 php-apc
sudo mkdir /var/www/drupal
sudo mv drupal-7.12/* drupal-7.12/.htaccess /var/www/drupal
sudo cp /var/www/drupal/sites/default/default.settings.php /var/www/drupal/sites/default/settings.php
sudo chown www-data:www-data /var/www/drupal/sites/default/settings.php
sudo mkdir /var/www/drupal/sites/default/files
@mlconnor
mlconnor / walk_array.php
Created June 25, 2012 17:19
php function to walk an array/object recursively
/**
* works for json objects. will replace all
* keys and values with the result of the
* closure.
*/
function walk_recursive($obj, $closure) {
if ( is_object($obj) ) {
$newObj = new stdClass();
foreach ($obj as $property => $value) {
$newProperty = $closure($property);
@alexwybraniec
alexwybraniec / gist:2972487
Created June 22, 2012 12:32
Enabling Memcached graphing in Munin, Ubuntu 10.04 LTS, with munin-node already installed
sudo apt-get update
sudo apt-get install munin-plugins-extra
cd /etc/munin/plugins
sudo ln -snf /usr/share/munin/plugins/memcached_ memcached_bytes
sudo ln -snf /usr/share/munin/plugins/memcached_ memcached_counters
sudo ln -snf /usr/share/munin/plugins/memcached_ memcached_rates
sudo aptitude install libcache-memcached-perl
sudo /etc/init.d/munin-node restart
sudo tail -f /var/log/munin/munin-node.log