Skip to content

Instantly share code, notes, and snippets.

View obonyojimmy's full-sized avatar
probably coding

jimmycliff obonyo obonyojimmy

probably coding
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
obonyojimmy /
Created October 23, 2023 22:53 — forked from sinbad/
My Gitea Backup & Restore Scripts
# `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
obonyojimmy / Caddyfile
Created September 19, 2023 19:15 — forked from SkYNewZ/Caddyfile
Example Caddyfile for using as load balancer
# Enable Debug mode
# Disable admin API
admin off
localhost {
obonyojimmy /
Created August 15, 2023 22:07 — forked from chenjianjx/
A python script which starts celery worker and auto reload it when any code change happens.
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 import PatternMatchingEventHandler
import psutil ##pip install psutil
import os
obonyojimmy /
Created November 3, 2021 21:42 — forked from slowkow/ is a simple module for reading GTF and GFF files
#!/usr/bin/env python
Kamil Slowikowski
December 24, 2013
Read GFF/GTF files. Works with gzip compressed files and pandas.
obonyojimmy /
Created April 30, 2021 23:00 — forked from kjbrum/
A small bash script to search and kill processes
if [ -z "$1" ]; then
echo "You need to supply a search string..."
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
obonyojimmy /
Created December 20, 2020 02:05 — forked from danrubins/
Legal Robot's options for helmet.js

Security Headers at Legal Robot

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'

obonyojimmy /
Created December 6, 2020 00:22 — forked from xflr6/
Recursively traverse the directory tree of a Google Drive folder as variation of os.walk()
# - os.walk variation with Google Drive API
import os
from apiclient.discovery import build # pip install google-api-python-client
FOLDER = 'application/'
def get_credentials(scopes, secrets='~/client_secrets.json', storage='~/storage.json'):
from oauth2client import file, client, tools
obonyojimmy /
Created October 24, 2020 23:14 — forked from olih/
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

obonyojimmy /
Created September 24, 2020 03:09 — forked from lakshmanok/
Launch DLVM using gcloud
# A1. Launch a notebook instance and get URL to Jupyter running on it
STARTUP_SCRIPT="git clone"
echo "Launching $INSTANCE_NAME"
gcloud compute instances create ${INSTANCE_NAME} \
--machine-type=n1-standard-2 \
--scopes=, \