Skip to content

Instantly share code, notes, and snippets.

View jdupl's full-sized avatar

Justin Duplessis jdupl

  • Freelancer
  • St-Wenceslas
View GitHub Profile
@jdupl
jdupl / mediawiki
Created November 15, 2016 14:30
various nginx configs
upstream php5-fpm-sock {
server unix:/var/run/php5-fpm.sock;
}
server {
server_name ..;
listen 80;
if ($ssl_protocol = "") {
rewrite ^ https://..$request_uri? permanent;
300
60
60
60
60
65
66
59
45
23
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDdn7lkryIAQZALu9jMLiUN32osq4u3e8Lbk8881iDY60hOLNtcetYKu8YQSZght95en6LicSLWLBZzCqwwzs0gNyXDZc0mlknp/8o7UhF5BwrrXlsqBK0Y+J78TFnWKWx/NTGQYIEYsnU8JQu3scaaOl66nEK3cwjhIdvsdOHDe8BEvPGB8IMV/0AEexfTLftVLa+wm7ZUdvpBZsrIXOcjprGorhHCd2fjmgQ48wIUg7yMmc467N8VRwvLpvnYshbt07X6i3ddNmJKKgp6k8nckfIAQ3EACZckc4Ct5QnllM70G2muJphhp+38cUJAuixy8L11UrlYAMYkNRawR/wj drfoliberg@gmail.com
@jdupl
jdupl / gist:ce8d713b96d8abc5fc55
Created September 9, 2015 22:10
find ext4 partition offset
bs=512
for i in {1..10000000}; do
echo ">>>>$i"
mount -o offset=$(($bs*$i)) -t ext4 /dev/sda1 /mnt
if [ $? == 0 ]; then
echo "Found ext4 at $(($bs*$i)) bytes !"
umount /mnt
break
fi
@jdupl
jdupl / gist:b6fafb76d80c7b445f38
Created June 7, 2015 03:22
vz to lxc ct host to host migration
rsync -a --exclude=etc/inittab --exclude=etc/network/interfaces --exclude=dev/ --exclude=sys/ --exclude=proc/ "$VZ_CT_PATH" ssh "$HOST:/var/lib/lxc/$LXC_NAME/rootfs/"
@jdupl
jdupl / gist:425314bebc075419d2be
Last active August 29, 2015 14:16
nginx lanmomo
upstream app_lanmomo {
server 127.0.0.1:3000;
keepalive 8;
}
server {
root /home/lanmomo/www;
index index.html index.htm;
# Make site accessible from http://localhost/
Traceback (most recent call last):
File "./main.py", line 5, in <module>
import pyopencl as cl
File "/usr/local/lib/python2.7/dist-packages/pyopencl-2014.1-py2.7-linux-x86_64.egg/pyopencl/__init__.py", line 765, in <module>
_add_functionality()
File "/usr/local/lib/python2.7/dist-packages/pyopencl-2014.1-py2.7-linux-x86_64.egg/pyopencl/__init__.py", line 382, in _add_functionality
from pytools import memoize_method
File "/usr/local/lib/python2.7/dist-packages/pytools-2014.3.5-py2.7.egg/pytools/__init__.py", line 5, in <module>
from six.moves import range, zip, intern, input
ImportError: cannot import name intern
@jdupl
jdupl / gist:2883beaa03f72d99b18d
Last active August 29, 2015 14:15
install log
ctags -R src || true
/usr/bin/python setup.py install
running install
/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py:2512: PEP440Warning: 'python-apt (0.9.3.5ubuntu1)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
PEP440Warning,
/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py:2512: PEP440Warning: 'python-debian (0.1.21-nmu2ubuntu2)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
PEP440Warning,
/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py:2512: PEP440Warning: 'apturl (0.4.1ubuntu4)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migra
@jdupl
jdupl / gist:9083f596fdcdd0dfc8e3
Created February 2, 2015 03:48
rutorrent jessie
wget http://dl.bintray.com/novik65/generic/rutorrent-3.6.tar.gz
--2015-02-02 03:42:02-- http://dl.bintray.com/novik65/generic/rutorrent-3.6.tar.gz
Connecting to dl.bintray.com (dl.bintray.com)|108.168.194.92|:80... connected.
HTTP request sent, awaiting response... 302
Location: http://d29vzk4ow07wi7.cloudfront.net/5870cddef717c83560e89aee56f2b7635ed1c90d?response-content-disposition=attachment%3Bfilename%3D%22rutorrent-3.6.tar.gz%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXNvdXJjZSI6Imh0dHAqOi8vZDI5dnprNG93MDd3aTcuY2xvdWRmcm9udC5uZXQvNTg3MGNkZGVmNzE3YzgzNTYwZTg5YWVlNTZmMmI3NjM1ZWQxYzkwZD9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPWF0dGFjaG1lbnQlM0JmaWxlbmFtZSUzRCUyMnJ1dG9ycmVudC0zLjYudGFyLmd6JTIyIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNDIyODQ4NTgyfSwiSXBBZGRyZXNzIjp7IkFXUzpTb3VyY2VJcCI6IjAuMC4wLjAvMCJ9fX1dfQ__&Signature=Ja9rk6eJaHYdU3Uli0aDQ-CpLYvxsxkqjk0C1ULtCffy0-IVtWQbGB-fMhDQeti~QE8xBBozBsSEcXJjz-u1prpOKX6r9PAe~rLqzfjbQKU~BziPTHkNKsENt4O2im~o6GJGFJEGSly3Ho1apmp7Nmx0f8orBd4Xnn4ArstD8LhIm6MrW
@jdupl
jdupl / gist:cdfe47af8db355ea2e24
Created February 2, 2015 03:47
rutorrent wheezy
wget http://dl.bintray.com/novik65/generic/rutorrent-3.6.tar.gz
--2015-02-02 03:45:19-- http://dl.bintray.com/novik65/generic/rutorrent-3.6.tar.gz
Resolving dl.bintray.com (dl.bintray.com)... 108.168.194.92, 108.168.194.91
Connecting to dl.bintray.com (dl.bintray.com)|108.168.194.92|:80... connected.
HTTP request sent, awaiting response... 302
Location: http://d29vzk4ow07wi7.cloudfront.net/5870cddef717c83560e89aee56f2b7635ed1c90d?response-content-disposition=attachment%3Bfilename%3D%22rutorrent-3.6.tar.gz%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXNvdXJjZSI6Imh0dHAqOi8vZDI5dnprNG93MDd3aTcuY2xvdWRmcm9udC5uZXQvNTg3MGNkZGVmNzE3YzgzNTYwZTg5YWVlNTZmMmI3NjM1ZWQxYzkwZD9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPWF0dGFjaG1lbnQlM0JmaWxlbmFtZSUzRCUyMnJ1dG9ycmVudC0zLjYudGFyLmd6JTIyIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNDIyODQ4Nzc5fSwiSXBBZGRyZXNzIjp7IkFXUzpTb3VyY2VJcCI6IjAuMC4wLjAvMCJ9fX1dfQ__&Signature=UQqQLl-NA5PlM7sgIrh0-nGn6mmF6fw8JJYez9x7PN0LX7f6jfE6S9USqJKUmdGmzzwEZf4Kr9zI3po24kKmis69OYNgOilsDa0Jc