Skip to content

Instantly share code, notes, and snippets.

View baradhili's full-sized avatar

bret watson baradhili

  • 05:21 (UTC +08:00)
View GitHub Profile
@cander
cander / basic.sh
Created May 25, 2012 04:47
Bourne Basic - a BASIC interpreter implemented (painfully) in pure Bourne shell
#!/bin/sh
#
#
# From: allbery@ncoast.UUCP (allbery@ncoast.UUCP)
# Subject: bournebasic
# Newsgroups: comp.sources.misc
# Date: 1987-08-18 18:54:12 PST
#
# Here's a useful BASIC interpreter written in Bourne shell.
# There's no manual but this demo shows the most salient features:
@emiller
emiller / yoga-auto-rotate
Last active April 22, 2024 15:44
Lenovo Yoga 13 tablet mode / auto rotation script (ubuntu/debian)
#!/bin/bash
#
# yoga-auto-rotate -- ghetto-style tablet mode, with keyboard and all.
#
# Simple little script that will detect an orientation change for a
# Lenovo Yoga 13 (very hackily) and adjust the active display's
# orientation and disable/enable the touchpad as necessary.
#
# The Yoga 13 will emit keycode `e03e` at one second intervals
# when the screen is flipped into tablet mode. Since this keycode
@rubo77
rubo77 / rotate-screen.sh
Last active October 9, 2023 11:30
This script rotates the screen and touchscreen input, disables or enbles the touchpad, and dis- or enables the virtual keyboard on a Lenovo Yoga 13 or Yoga 2 Pro (source: http://askubuntu.com/q/405628/34298)
#!/bin/bash
# This script rotates the screen and touchscreen input 90 degrees each time it is called,
# also disables the touchpad, and enables the virtual keyboard accordingly
# by Ruben Barkow: https://gist.github.com/rubo77/daa262e0229f6e398766
#### configuration
# find your Touchscreen and Touchpad device with `xinput`
TouchscreenDevice='ELAN Touchscreen'
TouchpadDevice='SynPS/2 Synaptics TouchPad'
@icoloma
icoloma / backup
Last active March 2, 2018 04:45
Backup a Github repository into a local file. Useful when retiring a Github repository, but keeping a backup copy for a rainy day in Dropbox / Drive / Box.
#!/bin/bash
# Backup the repositories indicated in the command line
# Example:
# bin/backup user1/repo1 user1/repo2
set -e
for i in $@; do
FILENAME=$(echo $i | sed 's/\//-/g')
echo "== Backing up $i to $FILENAME.bak"
git clone git@github.com:$i $FILENAME.git --mirror
cd "$FILENAME.git"
@JMichaelVelasquez
JMichaelVelasquez / migration-bitbucket-to-github
Created November 27, 2016 21:03
Migrating from BitBucket to GitHub
If you’re anything like me who didn't want to pay for github before their new business strategy, then most likely you use BitBucket or hosted your own (come ‘on, it was free!). Problem with that is now your activities or contributions are fragmented between the different services. Now that I've chosen GitHub, I found myself migrating the git repos.
Here is my copy and paste script I use for migration which also carries your history, which without it, defeats the purpose of it!
$ cd ~/Sites/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin git@github.com:JMichaelVelasquez-change-user/your-new-repo.git
$ git push origin master
@ednisley
ednisley / Vacuum Hose Fittings.scad
Created March 7, 2017 19:59
OpenSCAD source code: Shop vacuum hose adapters and fittings
// Vacuum Hose Fittings
// Ed Nisley KE4ZNU July 2016
// March 2017
Layout = "HoseBarb"; // PVCtoHose ExpandRing PipeToPort FVacPipe FVacFitting HoseBarb
//- Extrusion parameters must match reality!
// Print with 2 shells and 3 solid layers
ThreadThick = 0.25;
@maxwelleite
maxwelleite / ttf-ms-tahoma-installer.sh
Last active May 16, 2024 06:43
Script to install the original Microsoft Tahoma font on Ubuntu distros
#!/bin/bash
# Author: Maxwel Leite
# Website: http://needforbits.wordpress.com/
# Description: Script to install the original Microsoft Tahoma Regular and MS Tahoma Bold (both version 2.60) on Ubuntu distros.
# Dependencies: wget and cabextract
# Tested: Ubuntu Saucy/Trusty/Xenial/Bionic
output_dir="/usr/share/fonts/truetype/msttcorefonts/"
tmp_dir="/tmp/ttf-ms-tahoma-installer"
@maxwelleite
maxwelleite / ttf-wine-tahoma-installer.sh
Last active July 20, 2024 15:42
Script to install the latest Wine Tahoma fonts on Ubuntu distros
#!/bin/bash
# Author: Maxwel Leite
# Website: http://needforbits.wordpress.com/
# Description: Script to install the latest Wine Tahoma Regular and Wine Tahoma Bold fonts on Ubuntu distros from the Wine Project.
# The Wine project includes the free and open-source fonts Wine Tahoma Regular and Wine Tahoma Bold released under LGPL
# designed to have identical metrics to the Microsoft Tahoma font. This was done because Tahoma is available by default
# on Windows, and many applications expect the font to be available.
# Dependencies: wget
# Tested: Ubuntu Saucy/Trusty/Xenial/Bionic
# Latest Update: 20/11/2020
@cubicleWar
cubicleWar / SyncController.php
Created October 27, 2017 04:16
Laravel Authentication Proxy Controller for CouchDB/PouchDB Syncing
<?php
//
// SyncController
//
// A controller for Laravel authentication when performing CouchDB syncing.
//
// This controller assumes a user per database approach and that when a user registers with the Laravel
// web app a couchdb_username is generated and stored in the user record. This name is used for the
// creation of a corresponding couchdb user and database.
//
@seLain
seLain / openproject.conf
Last active November 9, 2023 19:30
nginx config for openproject
# assume :
# - openproject installed in /opt/openproject
# - local port: 6000
# - external port: 6020
server {
listen 6020;
server_name SERVER_DOMAIN_NAME;
root /opt/openproject/public;