Skip to content

Instantly share code, notes, and snippets.

View skriticos's full-sized avatar

Sebastian Bartos skriticos

  • pgsw.eu
  • Germany
View GitHub Profile
@skriticos
skriticos / pygtk-cairo-opaque-xshape-window-from-png.py
Created April 17, 2009 21:06
Transparent, irregular edge splash screen with pyGTK and XShape.
""" Transparent, irregular edge splash screen with pyGTK and XShape.
Takes a png image with transparent section, creates a window with pyGTK, puts this image in
there with cairo and then trims the edges with X11 XShape clipping extension.
This file demonstrates a python script which loads a png image of size 800x650 and name base.png
Then it creates a GTK+/Cairo window with opaque settings from the png file and the transparent
portions cut out with a mask. Basic, but works and looks great.
Note: this is a proof of concept file. It works, but it is by no means production ready.
"""
#! /bin/bash
# This script searches for suspicious files in the paths ${DEFAULT_DIRS[@]} or in TARGET.
# It can also remove them. Based on blacklist and whitelist's.
#################
### VARIABLES ###
#################
#!/bin/bash
# I think I must have been really bored when I wrote this litte script.
# Well, it is a good reference for true/false evaluation.
echo
echo "Testing \"0\""
if [ 0 ] # zero
then
echo "0 is true."
#! /bin/bash
# This was a bit toying around with bootstrapping based on autotools.
LIBRARY=0
fn_print_help ()
{
echo "NAME"
echo " bootstrap - create acme programming project"
echo
#! /usr/bin/env python3
""" Fifo read/write handler snipet
Opens the file 'thefifo' for reading and writing. Writes something to the
fifo and then enters the read loop. The data written will be recovered
unless some other process is reading the file, as the delay will allow the
other process to read it. (Try '% cat thefifo' before running the script.)\
"""
import os, time, sys, atexit
#! /usr/bin/env python3
""" Cleaning script based on .gitignore file, the 'find' and 'rm' command.
It removes files with .gitignore pattern.
This script reads the .gitignore file, parses the patterns found there to a
shell remove command and then executes it.
- With the 'dirs' option it also removes directories.
- With the 'debug' option it just prints the command it would execute and exits.
#! /usr/bin/env python3
""" Linux / *NIX daemon base code.
This script daemonizes its self with the start option and kills an already
running daemon with the stop option. It's kept minimal and simple, but it works
and can be extended/re-factored as base-code for a useful daemon.
Note: point of daemons is that they are quite and run in the background, add
some logging if you are developing a daemon, saves a lot of headaches.
"""
#! /usr/bin/env python3
""" Terminal command shortcut scirpt.
This script reads a command data file (~/.scdata) and executes commands from it.
There are two command execution models:
1. by argement, if you invoke it with a number, it executes this command
and exits. If you invoke it with -e opion, it opens the command file
for editing and then enters the main loop.
2. by loop, if you invoke it withouth an argument, it prints the
availible commands and promts for command number (id) to execute.
" Seth Kriticos' vimrc file
" Last update: 2010-03-19
" Note - This configuration is for cterm mode (color terminal)
" Never got around liking the GUI version
" (problematic command line integration)
" For GUI use, the highlight commands should be adjusted
" Editor behaviour
set nocompatible
set autoread
@skriticos
skriticos / manlike_formatter.py
Created September 8, 2009 10:03
manpage like formatter function for python 3
#! /usr/bin/env python3
# Note: this was just a little toying, rst2man is much better.
import string
import textwrap
def _fmt_help(name, title, description, *args):
"""
IN