Skip to content

Instantly share code, notes, and snippets.

@igniteflow
igniteflow / gist:4474040
Last active October 9, 2024 08:05
Create a folder and set user:group with Python's os module
import os
import pwd
file_path = '/tmp/example'
if not os.path.exists(file_path):
os.makedirs(file_path) # creates with default perms 0777
uid, gid = pwd.getpwnam('root').pw_uid, pwd.getpwnam('www-data').pw_uid
os.chown(file_path, uid, gid) # set user:group as root:www-data
# go check with ls -lah /tmp/example
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"