Skip to content

Instantly share code, notes, and snippets.

View masasdani's full-sized avatar

Masas Dani masasdani

View GitHub Profile
@masasdani
masasdani / scriptpermission
Created October 19, 2011 04:34
change default secure permission to /var/www/
#find /var/www/ -type d -print0 | xargs -0 chmod 755
#find /var/www/ -type f -print0 | xargs -0 chmod 644
@masasdani
masasdani / openClose
Created November 14, 2011 04:09
Event to manipulate Visibility Element HTML
function tutup(id){
document.getElementById(id).style.visibility='hidden';
}
function buka(id){
document.getElementById(id).style.visibility='visible';
}
@masasdani
masasdani / symlink
Created February 4, 2012 23:21
symlink to different target directory name
@masasdani
masasdani / x-session-manager
Created February 4, 2012 23:38
set default desktop environment (startx)
sudo update-alternatives --config x-session-manager
@masasdani
masasdani / pureubuntu
Created February 7, 2012 10:25
remove ubuntu 11.10 desktop componen
sudo apt-get remove adium-theme-ubuntu apg appmenu-gtk appmenu-gtk3 appmenu-qt at-spi2-core bamfdaemon banshee banshee-extension-soundmenu banshee-extension-ubuntuonemusicstore baobab binfmt-support bluez-gstreamer branding-ubuntu brasero brasero-cdrkit brasero-common checkbox checkbox-gtk cli-common compiz compiz-core compiz-gnome compiz-plugins-default compiz-plugins-main-default compizconfig-backend-gconf deja-dup duplicity dvd+rw-tools empathy empathy-common eog evolution-data-server evolution-data-server-common example-content gbrainy gedit gedit-common geoclue geoclue-ubuntu-geoip ginn gir1.2-atspi-2.0 gir1.2-gnomebluetooth-1.0 gir1.2-gtksource-3.0 gir1.2-indicate-0.6 gir1.2-peas-1.0 gir1.2-totem-1.0 gir1.2-totem-plparser-1.0 gir1.2-wnck-3.0 gnome-bluetooth gnome-control-center gnome-control-center-data gnome-desktop3-data gnome-disk-utility gnome-font-viewer gnome-icon-theme-symbolic gnome-media gnome-nettool gnome-online-accounts gnome-orca gnome-power-manager gnome-screensaver gnome-screenshot gnome-
@masasdani
masasdani / snowflake.css
Created February 18, 2012 07:30
css snowflake
* {
margin: 0;
padding: 0;
}
a {
color: white;
font-style: italic;
}
@masasdani
masasdani / mysql-backup-and-reset
Created March 9, 2012 06:33
mysql backup and reset
#mysql-backup
mysqldump -h localhost –u root –p myrootpassword db_name > db_test.sql
#for multiple database
mysqldump -h localhost –u root –p myrootpassword db_name1 db_name2 > db_test.sql
#for all table
mysqldump -h localhost –u root –p myrootpassword -all-databases > db_test.sql
#for specifiec table
@masasdani
masasdani / ssh-git
Created March 20, 2012 17:02
membangun public git repository di ubuntu (jalur ssh)
#install git
$ sudo apt-get -y install git-core gitosis
#meng inisialisasikan gitosis menggunakan key kita.
$ sudo -H -u gitosis gitosis-init < /home/badak/.ssh/id_rsa.pub
#key harus berupa .pub apabila di dalam folder .ssh kita belum ada, bisa digenerate menggunakan ssh-keygen
$ ssh-keygen -t rsa -C "[email protected]"
#clone gitosis-admin confoguration
@masasdani
masasdani / git-daemon
Created March 20, 2012 17:09
script git daemon untuk mengaktifkan protokol git
# Taken from here: http://pastie.org/227647
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=git-daemon
PIDFILE=/var/run/$NAME.pid
DESC="the git daemon"
DAEMON=/usr/lib/git-core/git-daemon
DAEMON_OPTS="--base-path=/srv/gitosis/repositories --export-all --verbose --syslog --detach --pid-file=$PIDFILE --user=gitosis --group=nogroup"
test -x $DAEMON || exit 0
@masasdani
masasdani / ANN.java
Created January 18, 2013 04:21
artifisial neural network, menggunakan sebuah layer dan bias.
package com.masasdani.ann;
import java.util.Random;
public class ANN {
private double alpha; //nilai yg ditentukan di awal, untuk menentukan delta w2
private int hiddenLayer; // digunakan untuk menentukan banyak node hidden di layer 1
private double w1[][]; // bobot dari input ke hidden layer
private double wbias[]; // bias dari input ke hiden layer