Skip to content

Instantly share code, notes, and snippets.

View sunix's full-sized avatar
⌨️
coding ...

Sun S. D. Tan sunix

⌨️
coding ...
View GitHub Profile
@sunix
sunix / scantofile.sh
Created August 5, 2012 08:49
My Brother brscan scanner S-KEY tool scan to file script. Scan from ADF, convert to PDF and merge PDFs files into a single one.
#! /bin/sh
set +o noclobber
#
# $1 = scanner device
# $2 = friendly name
#
#
# 100,200,300,400,600
#
@sunix
sunix / temperature_regulation.sh
Created May 21, 2013 08:10
This script change the CPU governor according to the temperature detected. Useful when your linux laptop is shutting down because the cpu is reaching 100°C. Script attached to: CPU overheats during high usage "throttling <not supported>" https://bugs.launchpad.net/bugs/22336
#!/bin/sh
#
###############################################################################
# Copyright (C) 2005 Francois COJEAN
# Copyleft 2007 Sun Seng David TAN
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
@sunix
sunix / sendto
Last active August 29, 2015 14:05
In Nautilus, will open a new email in Thunderbird with selected files as attachments. This script needs to be copied to ~/.gnome2/nautilus-scripts folder. Select the files to be attached, right click, select Scripts>sentto. Using nautilus scripts http://g-scripts.sourceforge.net/.
#!/bin/bash
# Copyright 2014, Sun Seng David TAN <[email protected]>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
@sunix
sunix / Dockerfile
Last active August 29, 2015 14:13
Dockerfile for codenvy with tomcat 8.0.15
#Reuse codenvy/jdk7 existing image
FROM codenvy/jdk7
#Get Tomcat-8.0.14 and install it
RUN mkdir /home/user/tomcat8 && \
wget -qO- "http://mirrors.ircam.fr/pub/apache/tomcat/tomcat-8/v8.0.18/bin/apache-tomcat-8.0.18.tar.gz" | tar -zx --strip-components=1 -C /home/user/tomcat8 && \
rm -rf /home/user/tomcat8/webapps/*
#Exposing ports
EXPOSE 8080
@sunix
sunix / contribution-tour.json
Last active August 29, 2015 14:13
Codenvy contribution guided tour
{
"name" : "Getting Started with Codenvy",
"hasWelcomeStep" : true,
"steps": [
{
"title": "Getting Started with Codenvy.",
"content": "Codenvy is a crazy fast, no-thrashing cloud IDE. Craft your finest code then command Docker-based microservices to build, run and debug from anywhere.\n\nThis tour introduces Codenvy's Contribution flow.",
"element": "gwt-debug-MainToolbar/runApp-true",
"placement": "BOTTOM",
"xOffset": "200",
@sunix
sunix / Dockerfile
Last active August 29, 2015 14:18
Devoxx fr 2015 - Spring Petclinic Dockerfile - Tomcat 8 MySQL - Codenvy
FROM codenvy/jdk7
# Install Tomcat8
RUN mkdir /home/user/tomcat8 && \
wget -qO- "http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.23/bin/apache-tomcat-8.0.23.tar.gz" | tar -zx --strip-components=1 -C /home/user/tomcat8 && \
rm -rf /home/user/tomcat8/webapps/*
EXPOSE 8080
ENV CODENVY_APP_PORT_8080_HTTP 8080
WORKDIR /home/user/tomcat8/bin
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
defscrollback 8192
startup_message off
vbell off
caption always "%{+u wk}%?%-w%?%{rk}/%n %t\%{wk}%?%+w%?"
hardstatus alwayslastline "%{+b kw}%H|%{kg}%c%{kw}|%{ky}%Y-%m-%d%{kw}|%{kb}load %l"
{
"name" : "Contribute blog.sunix.org",
"hasWelcomeStep" : true,
"steps": [
{
"title": "Contribute to blog.sunix.org with Codenvy",
"content": "Thank you for contribuing to my blog, this is a temporary workspace with the github pages project blog.sunix.org checked out. You can help me in improving my blog site, make your changes and submit the pull request with the Pull Request tab on the right.",
"element": "gwt-debug-MainToolbar/New",
"placement": "BOTTOM",
"xOffset": "500",
@sunix
sunix / Dockerfile
Created July 31, 2015 09:34
Jekyll Dockerfile
FROM sunix/jekyll4che
ENV CODENVY_APP_BIND_DIR /home/user/app
VOLUME ["/home/user/app"]
USER root
WORKDIR /home/user/app
CMD echo 'url: "http://'$CODENVY_HOSTNAME':'$CODENVY_PORT_4000'"' >> _config.yml && \
echo 'baseurl: ""' >> _config.yml && \