-
Create
.smbcredentials
username=username passowrd=password
-
Chage permission to prevent unwanted access
Start-Service sshd | |
# OPTIONAL but recommended: | |
Set-Service -Name sshd -StartupType 'Automatic' | |
# Confirm the Firewall rule is configured. It should be created automatically by setup. | |
Get-NetFirewallRule -Name *ssh* | |
# There should be a firewall rule named "OpenSSH-Server-In-TCP", which should be enabled | |
# If the firewall does not exist, create one | |
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 | |
# Set default shell | |
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force |
sudo iptables -t nat -A POSTROUTING -o usb0 -s 192.168.0.0/24 -j SNAT --to-source 192.168.42.82 |
from argparse import ArgumentParser | |
if __name__ == '__main__': | |
parser = ArgumentParser(description='') | |
parser.add_argument('position', type=str, help='position argument') | |
parser.add_argument('-o', '--optional', type=str, default='some string', help='optional argument') | |
parser.add_argument('-l', '--optional', type=int, nargs='+', help='parse a list') | |
parser.add_argument('-b', '--boolean', action='store_true', dest='visual', help='Show image frame') | |
import os | |
from fnmatch import fnmatch | |
for path, _, files in os.walk('root/dir'): | |
for filename in files: | |
if fnmatch(filename, 'match_pattern'): | |
print(os.path.join(path, filename)) |
{ | |
// general | |
"editor.renderWhitespace": "all", | |
"terminal.integrated.fontFamily": "Source Code Pro for Powerline", | |
// LaTeX | |
"workbench.settings.editor": "json", | |
"latex-workshop.latex.tools": [ | |
{ | |
"name": "xelatex", | |
"command": "xelatex", |
Create .smbcredentials
username=username
passowrd=password
Chage permission to prevent unwanted access
#!/bin/sh | |
git filter-branch --env-filter ' | |
OLD_EMAIL="hungtc@solab.me.ntu.edu.tw" | |
CORRECT_NAME="tc.hung" | |
CORRECT_EMAIL="hungtc@solab.me.ntu.edu.tw" | |
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ] | |
then | |
export GIT_COMMITTER_NAME="$CORRECT_NAME" | |
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL" |
[user] | |
email = hungtc@solab.me.ntu.edu.tw | |
name = tc.hung | |
[core] | |
editor = vim | |
ignorecase = false | |
[push] | |
default = matching | |
[alias] | |
tree = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) %C(cyan)%ar%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)' --all |
"\e[A": history-search-backward | |
"\e[B": history-search-forward | |
set completion-ignore-case on | |
set completion-prefix-display-length 3 | |
set mark-symlinked-directories On | |
set show-all-if-ambiguous On | |
set show-all-if-unmodified On | |
set visible-stats On |
import argparse | |
class MyClass(object): | |
def __init__(self, foo, bar): | |
self.foo = foo | |
self.bar = bar | |
def Print(self): | |
print self.foo | |
print self.bar |