This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
release_number=`lsb_release -r|cut -f 2` | |
if [ $release_number = "12.04" ]; then | |
# Please install gnome-session-fallback at first | |
unset SESSION_MANAGER | |
unset DBUS_SESSION_BUS_ADDRESS | |
gnome-session --session=gnome-classic & | |
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
: setlocal et sta sw=4 sts=4 expandtab | |
: ret! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
: write ++enc=utf-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# 中文编码支持 | |
echo "export LESSCHARSET=utf-8" > $HOME/.profile | |
git config --global gui.encoding utf-8 | |
git config --global i18n.commitencoding utf-8 | |
git config --global i18n.logoutputencoding utf-8 | |
git config --global core.quotepath false | |
# 别名设置 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.pythonrc.py | |
# enable syntax completion | |
# add the next line to your .bashrc | |
# export PYTHONSTARTUP=~/.pythonrc.py | |
try: | |
import readline | |
except ImportError: | |
print("Module readline not available.") | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mac 快捷键 | |
option + space — Alfred | |
control + space — finder | |
command + option + d — hide dock | |
command + ` — switch between the same app’s window | |
command + tab — switch between all the apps | |
command + shift + q — logout current account | |
command + delete — delete file | |
command + delete + shift — empty recycling bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\*\shell\runas] | |
@="获取管理员权限" | |
"NoWorkingDirectory"="" | |
[HKEY_CLASSES_ROOT\*\shell\runas\command] | |
@="cmd.exe /c takeown /f \"%1\" & icacls \"%1\" /grant administrators:F" | |
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" & icacls \"%1\" /grant administrators:F" | |
[HKEY_CLASSES_ROOT\exefile\shell\runas2] | |
@="获取管理员权限" | |
"NoWorkingDirectory"="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\*\shell\runas] | |
@="获取管理员权限" | |
"NoWorkingDirectory"="" | |
[HKEY_CLASSES_ROOT\*\shell\runas\command] | |
@="cmd.exe /c takeown /f \"%1\" & cacls \"%1\" /t /e /c /g administrators:F" | |
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" & cacls \"%1\" /t /e /c /g administrators:F" | |
[HKEY_CLASSES_ROOT\exefile\shell\runas2] | |
@="获取管理员权限" | |
"NoWorkingDirectory"="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 取倒数第二位 | |
select to_number(substr('12345', -2, 1)) from dual; | |
-- 正规匹配尾数为2,7的字符串 | |
select example_str from example_table | |
where regexp_like(example_str, '.*[27]$'); | |
-- 取日期(年-月-日)中的日 | |
select to_number(to_char(sysdate, 'dd')) from dual; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import pwd | |
import os | |
import re | |
import glob | |
PROC_TCP = "/proc/net/tcp" | |
STATE = { | |
'01':'ESTABLISHED', |
OlderNewer