Skip to content

Instantly share code, notes, and snippets.

View nicdoye's full-sized avatar
🚲
All shall be well, and all shall be well, and all manner of thing shall be well

Nic Doye nicdoye

🚲
All shall be well, and all shall be well, and all manner of thing shall be well
View GitHub Profile
@nicdoye
nicdoye / 7z-release.sh
Created November 13, 2015 10:38
7zip but exclude .git (Simples, but I don't use it that often).
#!/bin/bash
7z a -x'!*/.git' $1.7z $1
@nicdoye
nicdoye / fstab
Created January 30, 2013 11:14
Sample /etc/fstab for cygwin
# First just shows how to mount a UNC path
# Second just puts Google Drive somewhere useful
//<servername>/<path> /mnt/<path> smbfs acl,binary,nouser,posix=1 0 0
C:/Users/<username>/Google\040Drive /mnt/google smbfs acl,binary,nouser,posix=1 0 0
@nicdoye
nicdoye / mysqlbackup.sh
Created February 2, 2013 13:07
Backup your OpenShift MySQL database. My DB is only small so I didn't bother to compress it through a pipe. sftp it back from your local machine afterwards This is basically a quick hack from running "type mysql" on the OpenShift gear - hint: it's a bash function/alias
mkdir ~/app-root/data/tmp
mysqldump -h $OPENSHIFT_MYSQL_DB_HOST -P ${OPENSHIFT_MYSQL_DB_PORT:-3306} -u ${OPENSHIFT_MYSQL_DB_USERNAME:-'admin'} --password="$OPENSHIFT_MYSQL_DB_PASSWORD" --all-databases > ~/app-root/data/tmp//all.sql
@nicdoye
nicdoye / lc.sh
Created July 23, 2018 10:24
Rename files to lowercase, and change spaces to dashes.
#!/bin/bash
lc() {
for i in * ; do j="$(echo $i | tr '[:upper:]' '[:lower:]' | tr ' ' '-' )" ; [ "$i" != "$j" ] && mv "$i" "$j"; done
}
@nicdoye
nicdoye / docker-java-tomcat.csv
Last active June 11, 2018 08:31
Docker image sizes (for a medium post)
Name Base OS Java Vendor JRE/JDK Tomcat Size (MiB)
alpine:3.7 Alpine 4
gcr.io/distroless/base distroless 16
openjdk:8-jre-alpine Alpine OpenJDK JRE 78
openjdk:8-jdk-alpine Alpine OpenJDK JDK 97
tomcat:8.5-alpine Alpine OpenJDK JRE 8.5 101
nicdoye/micro-tomcat-jre distroless OpenJDK JRE 8.5 142
nicdoye/micro-tomcat-jdk distroless OpenJDK JDK 8.5 179
tomcat:8.5-slim Debian Slim OpenJDK JRE 8.5 213
alfresco/alfresco-base-java:8 CentOS Oracle JDK 468
@nicdoye
nicdoye / docker-size.sh
Created June 8, 2018 18:40
Finding a docker image's size
docker inspect openjdk:8-jdk-alpine | jq '.[] | "\(.Size) \(.RepoTags[0])"'
@nicdoye
nicdoye / hgweb.config
Created May 16, 2018 17:35
hgweb config
[paths]
/hg/ = /srv/hg/repos/*
[web]
style = gitweb
staticurl = /hg/static
allow_push = *
@nicdoye
nicdoye / uwsgi.ini
Created May 16, 2018 17:28
uWSGI config for mercurial
[uwsgi]
uid = uwsgi
gid = uwsgi
pidfile = /run/uwsgi/uwsgi.pid
emperor = /etc/uwsgi.d
stats = /run/uwsgi/stats.sock
chmod-socket = 660
emperor-tyrant = true
cap = setgid,setuid
; https://www.mercurial-scm.org/wiki/PublishRepositoriesOnNginx
@nicdoye
nicdoye / nginx-hg.conf
Last active May 16, 2018 17:20
nginx conf for Mercurial with uWSGI
location /hg/ {
uwsgi_pass unix:/run/uwsgi/hgweb.sock;
include uwsgi_params;
auth_basic "Mercurial repository";
auth_basic_user_file /etc/nginx/htpasswd;
client_max_body_size 0;
}
@nicdoye
nicdoye / activemq
Last active August 23, 2017 15:10
Init script for activemq. Known to work on RHEL 6, probably works on RHEL 5 and SLES Relies on variables set in /etc/sysconfig/activemq
#!/bin/bash
#
# activemq Starts ActiveMQ.
#
#
# chkconfig: 345 88 12
# description: ActiveMQ is a JMS Messaging Queue Server.
### BEGIN INIT INFO
# Provides: activemq
### END INIT INFO