Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am oscarcck on github.
  • I am oscarcck (https://keybase.io/oscarcck) on keybase.
  • I have a public key ASBTzWna5QzJNiOgLRxbTKMkS1LjautuSgvqTz5fmfjTsAo

To claim this, I am signing this object:

@oscarcck
oscarcck / gist:f6ef52aecc649551f381
Created Jul 25, 2014
SFTP Only access using OPenSSH with ChrootDirectory
View gist:f6ef52aecc649551f381

Restricted SFTP-only access to a single directory using OpenSSH

Edit /etc/ssh/sshd_config Match Group sftp-users

Force the connection to use SFTP and chroot to the required directory.

ForceCommand internal-sftp ChrootDirectory /home/sftp-users

Disable tunneling, authentication agent, TCP and X11 forwarding.

PermitTunnel no AllowAgentForwarding no

View _ey
#compdef ey
#autoload
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Engineyard (https://github.com/engineyard/engineyard).
#
# ------------------------------------------------------------------------------
# Authors
View tar
[root @test /root ]# tar [-zxcvfpP] filename
[root @test /root ]# tar -N 'yyyy/mm/dd' /path -zcvf target.tar.gz source
參數說明:
-z :是否同時具有 gzip 的屬性?
-x :解開一個壓縮檔案的參數指令!
-t :查看 tarfile 裡面的檔案!
-c :建立一個壓縮檔案的參數指令
-v :壓縮的過程中顯示檔案!
-f :使用檔名,請留意,在 f 之後要立即接檔名喔!不要再加參數!
   例如使用『 tar -zcvfP tfile sfile』就是錯誤的寫法,要寫成
@oscarcck
oscarcck / nt3conf.sh
Created Jul 18, 2012
netatalk 3.0 ./configure option flags on ubuntu 12.04
View nt3conf.sh
./configure --with-shadow --enable-fhs \
--enable-overwrite \
--enable-krbV-uam \
--with-libgcrypt-dir \
--with-cracklib=/var/cache/cracklib/cracklib_dict \
--enable-zeroconf \
--with-init-style=debian
@oscarcck
oscarcck / afp.conf
Created Jul 18, 2012
afp.conf sample for osx 10.7 lion time machine with netatalk 3.0 afpd on ubuntu 12.04
View afp.conf
;
; Netatalk 3.x configuration file
; http://netatalk.sourceforge.net/3.0/htmldocs/afp.conf.5.html
;
[Global]
; Global server settings
vol preset = default_for_all_vol
log file = /var/log/netatalk.log
uam list = uams_dhx.so,uams_dhx2.so
@oscarcck
oscarcck / .tm_properties
Created Apr 30, 2012
textmate 2 .tm_properties
View .tm_properties
# .tm_properties file from http://gist.github.com/1478685
# ---------------------------------------------------------
# ---------------------------------------------------------
# Display the name of the home directory
# ---------------------------------------------------------
#windowTitle = "$TM_DISPLAYNAME - ${CWD/^.*\///}"
#windowTitle = "$TM_DISPLAYNAME${TM_DIRECTORY/\A(?:\/Users\/Oscar\w+\/?(.*)|(.+))\z/${2:? – ${2/\A\/Users\/Oscar/~/}:${1/\A(?=.)/ – /}}/}"
windowTitle = "$TM_DISPLAYNAME${TM_DIRECTORY/\A(?:\/Users\/Oscar\/Documents\/(?:work\/)?(?!\b(?:communication|programming|reference)\b)\w+\/?(.*)|(.+))\z/${2:? – ${2/\/Users\/Oscar/~/}:${1/\A(?=.)/ – /}}/}"