Skip to content

Instantly share code, notes, and snippets.

@wassname
wassname / linux_x380.md
Last active June 24, 2024 06:04
xubuntu on a Thinkpad Yoga x380

This are a collection of fixes and tweaks I used to get Xubuntu 18.04 LTS working on a lenovo thinkpad X380 yoga laptop.

@grafov
grafov / www.sh
Created March 22, 2018 23:14
Surf with history using Rofi
#!/bin/dash
AGENT="Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3"
#OPTS=-u "$AGENT" -z 1.5
OPTS="-z 1.5"
HISTORY=.rofi-www-history
if [ "$1" = "" ]
then
URL=`cat $HISTORY | rofi -hide-scrollbar -dmenu -p "URL: "`
#!/bin/bash
# version 0.0.1
LOCALHISTFILE=/tmp/$USER.history.$$;
read -d '' RUN << EOF
export HISTFILE=$LOCALHISTFILE;
export HISTTIMEFORMAT='%F %T - '
bash -i;
awk '{print \"HIST \"\$0}' \$HISTFILE;
EOF
@leucos
leucos / ansible_approach.md
Last active August 2, 2021 20:43
My ansible approach

My ansible approach

Per service playbooks

Playbooks are written per service : a playbook is a collection of tasks, and eventually associated handers, templates, and files, that are required to properly install and setup a service.

Each playbook has a setup.yml entry point, which is responsible of including various necessary tasks to get the service up and running. Typically, this

@renyi
renyi / managers.py
Created August 18, 2012 07:34
Simple Geo model for Django
from geopy import units, distance
from mezzanine.core.managers import CurrentSiteManager
class GeoManager(CurrentSiteManager):
def near(self, latitude=None, longitude=None, distance_range=30):
queryset = super(GeoManager, self).get_query_set()
if not (latitude and longitude and distance_range):
return queryset.none()
@gingerlime
gingerlime / change_db_owner.sh
Created April 24, 2012 19:32
Postgresql - Changing ownership on all tables
#!/bin/bash
usage()
{
cat << EOF
usage: $0 options
This script set ownership for all table, sequence and views for a given database
Credit: Based on http://stackoverflow.com/a/2686185/305019 by Alex Soto
@datagrok
datagrok / gist:2199506
Last active April 8, 2023 17:36
Virtualenv's `bin/activate` is Doing It Wrong
@vangberg
vangberg / DWM-ON-OS-X.md
Created February 22, 2010 19:24
dwm on os x [work in progress!]

Installing and configuring dwm on OS X

  1. Install XQuartz (http://xquartz.macosforge.org) which is the development version of the X11.app that ships with OS X, which means it is way more up to date. I have had some weird issues with X11.app v. 2.3-something. XQuartz 2.5.0 fixed that.

  2. Install dwm from Homebrew, brew install dwm. This makes a bunch of necessary tweaks to the DWM configuration.

  3. Add the following script to $PATH, name it dwm-launch and chmod 755:

    cd ~
    

while true