Skip to content

Instantly share code, notes, and snippets.

View pmauduit's full-sized avatar

Pierre Mauduit pmauduit

View GitHub Profile
@pmauduit
pmauduit / postgres_table_row_count.sql
Created June 14, 2016 09:36
Row counts for all tables in a postgres db.
SELECT schemaname,relname,n_live_tup
FROM pg_stat_user_tables
ORDER BY n_live_tup DESC;
@pmauduit
pmauduit / polyglot.groovy
Last active June 4, 2016 11:35
java polyglot
@Grab(group='com.sun.script.jruby', module='jruby-engine', version='1.1.7')
import javax.script.ScriptEngineManager;
import javax.script.ScriptEngineFactory;
// See http://stackoverflow.com/questions/11838369/where-can-i-find-a-list-of-available-jsr-223-scripting-languages
// for other options :)
// I Would like to find a "ShellCode ScriptEngine" which could receive hex-encoded strings, like (helloworld):
// "\xeb\x0d\x48\x65\x6c\x6c\x6f\x20\x57\x6f\x72\x6c\x64\x0a\x00\xe8\x00\x00\x00\x00\x59\x48\x81\xe9\x6e\x05"
@pmauduit
pmauduit / notes.MD
Last active April 2, 2016 13:55
GN 2.x to 3 migration

sdi.g.o Geonetwork migration issues

  1. need to create a (temporary ?) hibernate_sequence in the public schema (or hibernate will complain)
  2. settings table is definitely too hard to migrate using the migration system, truncating the table then inserting a default gn3-geor provided one. (tested by removing parentid / id by hand before with no luck)
  3. permission denied for public.geometry_column => grant ALL on ...
  4. Xmx set to 8196m
  5. After all the previous changes, JAVA_OPTS looks like this:
JAVA_OPTS="-Djava.awt.headless=true -Xmx8192m -XX:+UseConcMarkSweepGC -Dgeorchestra.datadir=/etc/georchestra -Dgeonetwork.jeeves.configuration.overrides.file=/etc/georchestra/geonetwork/config/config-overrides-georchestra.xml"
@pmauduit
pmauduit / config
Last active March 31, 2016 18:30
LXC cheat sheet
lxc.utsname = cont1
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = lxcbr0
lxc.network.name = eth0
lxc.network.ipv4 = 192.168.0.2/24
lxc.network.ipv4.gateway = 192.168.0.1
lxc.rootfs = /var/lib/lxc/cont1/rootfs
@pmauduit
pmauduit / gwc.xml
Created March 27, 2016 17:11
geowebcache xml extract
 <wmsLayer>
<name>google</name>
<mimeFormats>
<string>image/png</string>
</mimeFormats>
<gridSubsets>
<gridSubset>
<gridSetName>EPSG:4326</gridSetName>
</gridSubset>
<gridSubset>
@pmauduit
pmauduit / README.md
Last active July 11, 2016 09:38
Jenkins - save/restore projects as XML

Jenkins save/restore projects one-liner

Save:

curl -s http://jenkins/job/JOBNAME/config.xml
@pmauduit
pmauduit / chuck.MD
Created March 16, 2016 20:02
First steps with ChucK

some chuck notes (no pun intended)

Launch a jack daemon along with pulseaudio:

sudo pasuspender -- jackd -d alsa -d hw:1

Launch an example:

@pmauduit
pmauduit / distributions
Last active February 21, 2016 17:49
reprepro configuration for geOr
Origin: geOrchestra
Label: geOrchestra
Codename: 15.12
Architectures: i386 amd64
Components: main
Description: Apt repository for geOrchestra 15.12
Origin: geOrchestra
Label: geOrchestra
Codename: master
@pmauduit
pmauduit / jessie.yml
Created February 4, 2016 14:04
docker-compose with a debian jessie
blah:
image: debian:jessie
ports:
- "2222:22"
entrypoint: /bin/bash
tty: true
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
public static void main(String[] args) {