Skip to content

Instantly share code, notes, and snippets.

View josepsmartinez's full-sized avatar

José Pedro Silveira Martinez josepsmartinez

View GitHub Profile
@josepsmartinez
josepsmartinez / timestamp.py
Last active May 10, 2022 17:41 — forked from wzpan/timestamp.py
Python datetime timestamps
import datetime
# ISO formatting
datetime.datetime.utcnow() # ('2022-05-10 04:18:09.297644')
datetime.datetime.now() # ('2022-05-10 01:18:09.297743')
# Custom formatting
## Pretty ('Saturday, 15. December 2012 11:19AM')
datetime.datetime.now().strftime("%A, %d. %B %Y %I:%M%p")
## Calendar ('2012-12-15')
@josepsmartinez
josepsmartinez / ssh-set-permissions.sh
Last active October 3, 2021 15:49
ssh permissions
#!/bin/bash
# Configs
chmod 700 $HOME/.ssh
chmod 644 $HOME/.ssh/authorized_keys
chmod 644 $HOME/.ssh/known_hosts
chmod 644 $HOME/.ssh/config
# Keys
chmod 600 $HOME/.ssh/id_rsa