Skip to content

Instantly share code, notes, and snippets.

View phuongtailtranminh's full-sized avatar

Tran Minh Phuong phuongtailtranminh

  • Hanoi
View GitHub Profile
@phuongtailtranminh
phuongtailtranminh / List Servers you may need
Last active December 4, 2016 13:36
List Servers you may need
https://console.cloud.google.com/freetrial?page=0 (Sign up and get $300 to spend on Google Cloud Platform over the next 60 days. Credit Card with $ is required)
https://amazonlightsail.com/ (starting from 5$/month)
https://cloud.digitalocean.com/login (free with Github Student Pack, require Paypal)
@phuongtailtranminh
phuongtailtranminh / EDX - Disable Discussion Tab
Last active November 30, 2016 16:09
/edx/app/edxapp/edx-platform/lms/templates/courseware/tabs.html
## mako
<%namespace name='static' file='/static_content.html'/>
<%!
from django.utils.translation import ugettext as _
from django.core.urlresolvers import reverse
%>
<%page args="tab_list, active_page, default_tab, tab_image" expression_filter="h" />
<%
@phuongtailtranminh
phuongtailtranminh / Spring Roo
Last active December 5, 2016 04:13
Spring Roo
web mvc scaffold --class ~.web.PkgSmsLMCycleController --backingType ~.domain.PkgSmsLMCycle --path admin/pkgsmslmcycle
web mvc scaffold --class ~.web.PkgDataController --backingType ~.domain.PkgData --path admin/pkgdatacfg
# Install third party library to local maven repository
mvn install:install-file -Dfile=/path/to/file.jar -DgroupId=groupId -DartifactId=artifactId -Dversion=version -Dpackaging=jar
Reading package lists...
Building dependency tree...
Reading state information...
python-software-properties is already the newest version.
The following package was automatically installed and is no longer required:
libt1-5
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 166 not upgraded.
OK
You are about to add the following PPA to your system:
Reading package lists...
Building dependency tree...
Reading state information...
python-software-properties is already the newest version.
The following package was automatically installed and is no longer required:
libt1-5
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 166 not upgraded.
OK
You are about to add the following PPA to your system:
@phuongtailtranminh
phuongtailtranminh / Linux&OSX System Commands
Last active December 16, 2016 02:22
Linux&OSX System Commands
Get the system information (OS version): cat /etc/*-release
Lists open files and the corresponding processes: lsof -i :port
Get PID of the process which is running on specific port: netstat -nlp | grep "port"
Get the path of specific PID: ps -fp pid
Get the public ip: curl httpbin.org/ip
Read Realtime log: tailf /path/to/file
Get directory structure: tree /directory
Move to previous directory: cd - (actually it is $OLDPWD environment path)
Copy ssh public key to server: ssh-copy-id user@ip_address
Execute a command repeatedly: watch 'command'
@phuongtailtranminh
phuongtailtranminh / Linux Network Commands
Created November 17, 2016 03:44
Linux Network Commands
Network Interface Configurator.
- View network settings of an ethernet adapter:
ifconfig eth0
- Display details of all interfaces, including disabled interfaces:
ifconfig -a
- Disable eth0 interface:
ifconfig eth0 down
@phuongtailtranminh
phuongtailtranminh / Backup and Restore Linux Server
Last active August 5, 2019 14:47
Backup and Restore Ubuntu Server
Backup: sudo tar -cvpzf backup.tar.gz --exclude=/backup.tar.gz --exclude=/boot --one-file-system /
Restore: sudo tar -xvpzf /path/to/tar/file -C / --numeric-owner
# The vboxmanage is located at:
\path\to\virtualbox (example: ..\Oracle\VirtualBox)
# Clone a virtual machine (with Virtual Machine name) to specific folder:
vboxmanage clonevm Funix --basefolder D:\VMWare