เปิด Terminal แล้วทำตามนี้
$ mkdir -p $HOME/bin
สร้างไฟล์ $HOME/bin/free-mem
$ touch $HOME/bin/free-mem
ใส่โค้ด free-mem.sh ไปใน $HOME/bin/free-mem ให้ copy โค้ด free-mem.sh จะ command + C หรือ คลิกขวา copy ก็ได้ เอาให้ครบ
| Alive = True | |
| def code(): | |
| print "coding..." | |
| while Alive: | |
| code() | |
| print "I'm happy :)" |
| # This file used to download file from http://www.par-anoia.net/assessment/books/coding/Python/ | |
| # Created by Narate Ketram | |
| # 23/5/2013 | |
| import urllib | |
| from HTMLParser import HTMLParser | |
| url = "http://www.par-anoia.net/assessment/books/coding/Python/" | |
| file_names = [] |
| #!/usr/bin/python | |
| # thai-lotto-checking.py | |
| # author Narate Ketram | |
| # created on 2 June 2012 | |
| import urllib | |
| import urllib2 | |
| from HTMLParser import HTMLParser | |
| url = 'http://hopes.glo.or.th/lotto.php' |
| --[[ | |
| Created by : Narate Ketram, 20-11-2013 | |
| Changelog: | |
| - Refactoring code 30-11-2020 | |
| - fix extract_date function | |
| - update 21-11-2013 | |
| * add thaidatetime show date and time | |
| * change thaidate for show date only | |
| example : |
| FROM debian | |
| MAINTAINER Narate Ketram | |
| RUN mkdir -p ~/tmp | |
| RUN cd ~/tmp | |
| RUN apt-get update | |
| RUN apt-get -y install wget git libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make | |
| RUN wget http://openresty.org/download/ngx_openresty-1.5.8.1.tar.gz | |
| RUN tar -xzvf ngx_openresty-1.5.8.1.tar.gz |
| // created by : Narate Ketram | |
| package main | |
| import ( | |
| "fmt" | |
| "github.com/ant0ine/go-json-rest" | |
| "labix.org/v2/mgo" | |
| "labix.org/v2/mgo/bson" | |
| "net/http" |
| import java.util.Random; | |
| public class CountChars { | |
| static char[] chars; | |
| static int[] count; | |
| static String[][] graph; | |
| public static void main(String args[]) { | |
| chars = new char[100]; | |
| count = new int[26]; | |
| rand_char(chars); |
| #!/bin/bash | |
| # System Variables | |
| user=$(whoami) | |
| hostname=$(hostname | sed 's/.local//g') | |
| distro="OS X $(sw_vers -productVersion)" | |
| kernel=$(uname) | |
| uptime=$(uptime | sed 's/.*up \([^,]*\), .*/\1/') | |
| shell="$SHELL" | |
| terminal="$TERM" |
| #!/bin/bash | |
| action=$1 | |
| if [[ "$action" == "update" ]]; then | |
| softwareupdate -lv | |
| elif [[ "$action" == "upgrade" ]]; then | |
| softwareupdate -iva | |
| else | |
| echo "No action for $action" | |
| fi |