Skip to content

Instantly share code, notes, and snippets.

View gevasiliou's full-sized avatar

George Vasiliou gevasiliou

View GitHub Profile
@jrosco
jrosco / yoga-auto-rotate
Created May 22, 2016 09:26 — forked from emiller/yoga-auto-rotate
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
@IQAndreas
IQAndreas / caesar-cipher.sh
Last active August 30, 2023 09:39
A really simple Caesar Cipher in Bash (or Shell) using `tr`, can also easily be adjusted to encrypt/decrypt ROT13 instead.
# Caesar cipher encoding
echo "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG" | tr '[A-Z]' '[X-ZA-W]'
# output: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD
# Caesar cipher decoding
echo "QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD" | tr '[X-ZA-W]' '[A-Z]'
# output: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
# Can also be adjusted to ROT13 instead
@hannic
hannic / ROT13.sh
Last active January 18, 2023 04:17
ROT13/ROT47 is an example of the Caesar cipher, developed in ancient Rome. Unix command. tr transliterate
# encode
tr 'A-Za-z' 'N-ZA-Mn-za-m' <<<"The Quick Brown Fox Jumps Over The Lazy Dog"
# decode
echo "Gur Dhvpx Oebja Sbk Whzcf Bire Gur Ynml Qbt" | tr '[A-Za-z]' '[N-ZA-Mn-za-m]'
@Wollw
Wollw / bashbot.sh
Created August 12, 2012 07:07
IRC bot in written in bash
#!/usr/bin/env bash
# Open a connection to canternet
exec 3<>/dev/tcp/irc.canternet.org/6667;
# Login and join the channel.
printf "NICK BashBot\r\n" >&3;
printf "USER bashbot 8 * :IRC Bot in Bash\r\n" >&3;
sleep 2;
printf "JOIN #HackingIsMagic\r\n" >&3;
@Rafe
Rafe / gist:3102414
Created July 13, 2012 02:59
AWK cheatsheet
HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008
Compiled by Eric Pement - eric [at] pement.org version 0.27
Latest version of this file (in English) is usually at:
http://www.pement.org/awk/awk1line.txt
This file will also be available in other languages:
Chinese - http://ximix.org/translation/awk1line_zh-CN.txt
USAGE:
@pklaus
pklaus / StatusIcon.py
Created February 15, 2010 20:36
StatusIcon – A Simple Tray Icon Application Using PyGTK
#!/usr/bin/env python
# found on <http://files.majorsilence.com/rubbish/pygtk-book/pygtk-notebook-html/pygtk-notebook-latest.html#SECTION00430000000000000000>
# simple example of a tray icon application using PyGTK
import gtk
def message(data=None):
"Function to display messages to the user."
@snim2
snim2 / camerastream.py
Created December 13, 2009 00:00
Display the output of a webcam using Python and Pygame
import pygame
import pygame.camera
from pygame.locals import *
DEVICE = '/dev/video0'
SIZE = (640, 480)
FILENAME = 'capture.png'
def camstream():
pygame.init()