Skip to content

Instantly share code, notes, and snippets.

View stchris's full-sized avatar

Christian Stefanescu stchris

View GitHub Profile
@stchris
stchris / generate_odt.sh
Created December 7, 2022 19:55
Generate a large amount of LibreOffice ODT files with random content
#!/usr/bin/env bash
# number of .odt files to generate
HOW_MANY=100
# number of random words to insert
WORD_COUNT=5000
# file prefix
PREFIX="rand-"
for (( i=1; i<=$HOW_MANY; i++ )) do
@stchris
stchris / Dockerfile
Created June 17, 2019 08:17
Alpine Linux Dockerfile to install magic-wormhole
# This installs https://github.com/warner/magic-wormhole (a nifty
# utility to securely send stuff from one computer to another) on
# Alpine Linux
FROM alpine
RUN apk update && apk add build-base python3-dev libffi-dev openssl-dev && pip3 install magic-wormhole

Keybase proof

I hereby claim:

  • I am stchris on github.
  • I am 0chris (https://keybase.io/0chris) on keybase.
  • I have a public key whose fingerprint is ABAF F2DF 4D80 68EF 67EE CE0D A824 8C52 91D7 BC8A

To claim this, I am signing this object:

@stchris
stchris / heise-notify.py
Created February 2, 2012 11:35
Python script to show twitter updates with pyinotify
#!/usr/bin/python
import pynotify
import twitter
import time
last_id = {}
users = ['heiseonline']
def notify(title, text):
notification = pynotify.Notification(title, text)
@stchris
stchris / getimg.py
Created February 19, 2011 13:34
Improved version of getimg.sh - gets the 'image of the day' from NASA, writes the summary onto the image and sets it as the Gnome wallpaper.
#!/usr/bin/env python
"""
getimg.py
Gets the current image of the day from NASA and sets it as the
background in Gnome. The summary / description text is written
to the image.
Requires:
PIL (apt-get install python-imaging or pip install PIL)
@stchris
stchris / getimg.sh
Created February 7, 2011 18:57
Gets the 'image of the day' from NASA and sets it as the wallpaper (in Gnome)
#!/bin/bash
# source: http://blog.quaternio.net/2009/04/13/nasa-image-of-the-day-as-gnome-background/
# grabs the nasa image of the day by RSS feed and updates the gnome
# background. add this to your cron jobs to have this happen daily. this is,
# obviously, a hack, that is likely to break at the slightest change of NASA's
# RSS implementation. yay standards!
rss=`wget -q -O - http://www.nasa.gov/rss/lg_image_of_the_day.rss`
# source: http://www.reddit.com/r/django/comments/diqf9/if_you_allways_endup_googleing_how_to_code_down/c10igiw
import os
location = lambda x: os.path.join(os.path.dirname(os.path.realpath(__file__)), x)
MEDIA_ROOT = location('media')
#!/bin/sh
# If an external monitor is connected, place it with xrandr
# Adapted from: http://www.thinkwiki.org/wiki/Xorg_RandR_1.2#Now_automate_it_on_login
###### CHANGE THESE
# External output may be "VGA" or "VGA-0" or "DVI-0" or "TMDS-1"
EXTERNAL_OUTPUT="VGA1"
INTERNAL_OUTPUT="LVDS1"
# Resolution for the external monitor