Skip to content

Instantly share code, notes, and snippets.

View francoisjacques's full-sized avatar

François Jacques francoisjacques

View GitHub Profile
@francoisjacques
francoisjacques / lxc-centos
Last active December 16, 2015 09:38 — forked from hagix9/lxc-centos
#!/bin/bash
#
# template script for generating CentOS container for LXC
#
#
# lxc: linux Container library
# Authors:
# Put expressions that hit more files first.
/home/chroot/.*
/home/[^/]+/Workspaces?/.*/target/.*
/home/[^/]+/Workspaces?/.*/\.pants\.d.*
/home/[^/]+/\.m2/repository/.*
/home/[^/]+/\.ivy2/(?:cache|local|limiter)/.*
/home/[^/]+/.*(?:~|\.(?:log|tmp|bak|lock))
/home/[^/]+/S3/.*
/home/[^/]+/Virtualization/Machines/.*
# Change Java Runtime:
sudo update-alternatives --config java
# Delete Open-JDK
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
# Change fonts - remove hinting:
http://askubuntu.com/questions/32624/ugly-fonts-in-netbeans-how-can-i-make-it-use-the-system-font
# Change RubyMine AntiAliasing first:
@francoisjacques
francoisjacques / gist:100c3a71d8e02efe088c
Created October 26, 2015 15:20
VMWare 12 experimental emerge failure
***** 308-hardened.patch *****
PWD: /var/tmp/portage/app-emulation/vmware-modules-308.0-r1/work
PATCH TOOL: patch -> /usr/bin/patch
VERSION INFO:
GNU patch 2.7.5
Copyright (C) 2003, 2009-2012 Free Software Foundation, Inc.
Copyright (C) 1988 Larry Wall
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
@francoisjacques
francoisjacques / gist:3969dda6280987622ab4
Created October 27, 2015 05:09
2nd attempt for VMWare Workstation.
***** 304-hardened.patch *****
PWD: /var/tmp/portage/app-emulation/vmware-modules-304.2/work
PATCH TOOL: patch -> /usr/bin/patch
VERSION INFO:
GNU patch 2.7.5
Copyright (C) 2003, 2009-2012 Free Software Foundation, Inc.
Copyright (C) 1988 Larry Wall
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
@francoisjacques
francoisjacques / ddns-start
Last active December 10, 2021 00:51
dns-o-matic client for asuswrt
#!/bin/sh
# Typical location - /jffs/scripts/ddns-start
# NOTE - USERNAME and PASSWORD must be URL encoded, example @ becomes %40
USERNAME=CHANGE_ME_URL_ENCODED
PASSWORD=CHANGE_ME_URL_ENCODED
HOSTNAME=all.dnsomatic.com
IP=`curl --silent http://canhazip.com`
# Should be no need to modify anything beyond this point
/usr/sbin/curl --silent "https://$USERNAME:$PASSWORD@updates.dnsomatic.com/nic/update?hostname=$HOSTNAME&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG&myip=$IP" > /dev/null
@francoisjacques
francoisjacques / query_planner.markdown
Created September 2, 2016 15:51 — forked from hgmnz/query_planner.markdown
PostgreSQL query plan and SQL performance notes

Types of index scans

Indexes

Sequential Scan:

  • Read every row in the table
  • No reading of index. Reading from indexes is also expensive.
@francoisjacques
francoisjacques / basic.sql
Created September 2, 2016 16:40 — forked from nesquena/basic.sql
PostgreSQL Common Utility Queries
/* How to calculate postgreSQL database size in disk ? */
SELECT pg_size_pretty(pg_database_size('thedbname'));
/* Calculate size of a table including or excluding the index */
SELECT pg_size_pretty(pg_total_relation_size('big_table'));
SELECT pg_size_pretty(pg_relation_size('big_table')); /* without index */
/* See indexes on a table with `\d tablename` */
@francoisjacques
francoisjacques / docker-wordpress.sh
Created February 5, 2017 18:19 — forked from tatemz/docker-wordpress.sh
A quick way to get a WordPress installation up and running with Docker
#!/bin/bash
mkdir wordpress-site && cd wordpress-site
touch docker-compose.yml
cat > docker-compose.yml <<EOL
version: "2"
services:
my-wpdb:
@francoisjacques
francoisjacques / where_is.rb
Created April 5, 2017 03:59 — forked from wtaysom/where_is.rb
A little Ruby module for finding the source location where class and methods are defined.
module Where
class <<self
attr_accessor :editor
def is_proc(proc)
source_location(proc)
end
def is_method(klass, method_name)
source_location(klass.method(method_name))