Setting up PHP on Mac
Mac already has apache and php
Run Apache
sudo apachectl start
It redirects to /Library/WebServer/Documents
Configure PHP
sudo vi /etc/apache2/httpd.conf
In the config file, uncomment
#LoadModule php5_module libexec/apache2/libphp5.so...
Golang Handbook
Compile
> 6g hello.go > 6l hello.6 > ./6.out
Basic framework
import "fmt" func main(){ fmt.Println("Hello World!\n") }
Declaring Variables
var i int var theta float32 var...
Deployment of Jetty
WebAppProvider scans $jetty_home/webapps for automatic deployment.
ContextProvider scans $jetty_home/contexts for configuration files for automatic deployment.
shadowsocks for ubuntu
###install shadowsocks under ubuntu
-
sudo apt-get update
-
sudo python –version
-
apt-get install python-gevent python-pip
-
pip install shadowsocks
-
sudo find / -name shadows*
-
修改config.js
{
“server”:”127.0.0.1”, “server_port”:8388,...
Create swap file for Linux
Create swap files
> dd if=/dev/zero of=/tmp/swap_file bs=512k count=4000
> mkswap /tmp/swap_file
> swapon /tmp/swap_file
Add the following item to fstab for auto mounting
/tmp/swap swap swap defaults 0 0
Modify Swapness
- for once
sudo...
Shell
commands
for ((i=1;i<100;i++)); do $(curl < address> 1>/dev/null 2>%1 &); done
MySQL commands
Basic commands
show databases; use mysql; show tables; describe \<table\>; create database \<database\>; use \<database\>; create table \<table\> (segament); drop database \<database\>; drop table \<table\>; delete from \<table\>; select * from \<table\>; update table\_references set col\_name1=expr1 [,...
Useful Commands for Server
How to check the process that is using a specific port?
Speficy the port number as you wish. Here we use 8080.
$ netstat -nlptu |awk '{print $4,$7}' | grep 8080
Setting up FTP...
Typical Git Ignoring Settings for C
# Object files
*.o
*.ko
*.obj
*.elf
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
# Shared objects (inc. Windows DLLs)
*.dll
*.so
.so.
*.dylib
# Executables
*.exe
*.out
*.app
*.i
*86
*.x86_64
*.hex
# Debug files
...Setup Local Git Repo
If you are working on some confidential project, it is not a good idea to use github to do the version control and backup. A local repository may be necessary for such purpose.
For example, repository will be created locally...
Happy Valentine's Day
Kindheitserinnerung
Vor zwei Wochen habe ich einen Anruf von Vera bekommen. Da erinnerte ich mich an ein Bild aus unserer gemeinsamen Kindheit. Wir waren damals sieben Jahre alt und liefen zu Schule. Sie trug einen rosaroten Rock , eine weiße...
Overture
Added something to the site.
Love writting in Markdown.
Although we have many fancy tools to create funcy features, we still need to thank low level computer archetecture. Low level, like underground, dark and cold, but holds everything above.
Have...
Hello World!
Have fun
Never stop leaning
Keeping on trying