git checkout --orphan assets
git reset --hard
cp /path/to/cat.png .
git add .
git commit -m 'Added cat picture'
git push -u origin assets
#!/bin/bash | |
# `gitea dump` doesn't currently back up LFS data as well, only git repos | |
# It primarily backs up the SQL DB, and also the config / logs | |
# We'll backup like this: | |
# * "gitea dump" to backup the DB and config etc | |
# * tar / bzip all the repos since they will be skipped | |
# * Not rotated because git data is immutable (normally) so has all data | |
# * rsync LFS data directly from /volume/docker/gitea/git/lfs | |
# * No need for rotation since all files are immutable |
{ | |
# Enable Debug mode | |
debug | |
# Disable admin API | |
admin off | |
} | |
localhost { | |
# https://caddyserver.com/docs/caddyfile/directives/push |
''' | |
A python script which starts celery worker and auto reload it when any code change happens. | |
I did this because Celery worker's "--autoreload" option seems not working for a lot of people. | |
''' | |
import time | |
from watchdog.observers import Observer ##pip install watchdog | |
from watchdog.events import PatternMatchingEventHandler | |
import psutil ##pip install psutil | |
import os |
#!/usr/bin/env python | |
""" | |
GTF.py | |
Kamil Slowikowski | |
December 24, 2013 | |
Read GFF/GTF files. Works with gzip compressed files and pandas. | |
http://useast.ensembl.org/info/website/upload/gff.html |
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "You need to supply a search string..." | |
else | |
processes=$(ps aux | grep $1 -i | awk -F ' ' '{print $2}' | xargs) | |
echo "Processes: "$processes | |
while true; do | |
read -ep "Are you sure you want kill all '$1' processes? [y/N] " yesno | |
case $yesno in |
We're big fans of open source software at Legal Robot. We also know that getting security right is a tough job, so we want to share some of the useful tools we use to build and run Legal Robot and keep it secure.
We are also proud to run Legal Robot on the Meteor framework for Node.js. With this recent change, Helmet.js becomes the official recommendation for security headers in Meteor, replacing the previous Meteor browser-policy package.
One of the most helpful tools in our Meteor security toolbox at Legal Robot is Content Security Policy (CSP) — basically, our server tells the browser what code it is allowed to run and how to handle something like code injection from a malicious browser extension.
CSP can be quite tricky, but there are some excellent tools out there to help, like [Google'
# walk_gdrive.py - os.walk variation with Google Drive API | |
import os | |
from apiclient.discovery import build # pip install google-api-python-client | |
FOLDER = 'application/vnd.google-apps.folder' | |
def get_credentials(scopes, secrets='~/client_secrets.json', storage='~/storage.json'): | |
from oauth2client import file, client, tools |