Skip to content

Instantly share code, notes, and snippets.

View skorotkiewicz's full-sized avatar
💻
Programming

Sebastian Korotkiewicz skorotkiewicz

💻
Programming
View GitHub Profile
@skorotkiewicz
skorotkiewicz / IRC2Speech.py
Created December 8, 2016 15:06
IRC to Speech
import socket, string, os, re, time
#some user data, change as per your taste
SERVER = 'irc.freenode.net'
PORT = 6667
NICKNAME = 'MsgToSpeech'
CHANNEL = '#itunix-eu'
#open a socket to handle the connection
IRC = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@skorotkiewicz
skorotkiewicz / rpispeech.py
Created December 8, 2016 15:07
My Raspberry Pi speech Tweets!
import os, re, time
from twython import TwythonStreamer
# Search terms
TERMS = '#yes'
# Twitter application authentication
APP_KEY = ''
APP_SECRET = ''
@skorotkiewicz
skorotkiewicz / where.sql
Created December 8, 2016 15:08
WHERE id between 8571 and 139109
DELETE FROM punbb_posts WHERE id >= 8571 AND id <= 139109;
DELETE FROM punbb_posts WHERE id between 8571 and 139109;
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -F INPUT
iptables -F OUTPUT
iptables -F FORWARD
iptables -F -t nat
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
@skorotkiewicz
skorotkiewicz / gist:37573dce57caf0d4cf561b216a974f8e
Created December 8, 2016 15:09
Clone OpenSuse VirtualBox vm
Tested with OpenSuse 11.3
Before cloning, you will need to change some hdd stuff in fstab & menu.lst. Let's begin:
1) Start the vm to clone and login as root.
2) Get the info from your partitions:
opensuse11:~ # fdisk -l
@skorotkiewicz
skorotkiewicz / TrigMain.php
Created December 8, 2016 15:10
Trigonometry.php andTrigMain.php
<?php
include_once("Trigonometry.php");
header("Content-type: image/png");
function graphTrig()
{
$trig = new Trigonometry();
$setgraph = $trig->setGraph("cos");
@skorotkiewicz
skorotkiewicz / geturl.sh
Created December 8, 2016 15:11
Get URL and Images from website in Bash
wget -O - 'http://www.elektroda.pl/' | \
grep -o '<img src=['"'"'"][^"'"'"']*['"'"'"]' | \
sed -e 's/^<img src=['"'"'"]//' -e 's/["'"'"']$//'
wget -O - http://stackoverflow.com | \
grep -o '<a href=['"'"'"][^"'"'"']*['"'"'"]' | \
sed -e 's/^<a href=["'"'"']//' -e 's/["'"'"']$//'
@skorotkiewicz
skorotkiewicz / config.bash
Created December 8, 2016 15:12
init.d php-fastcgi start script in debian and nginx
#nano /etc/init.d/php-fastcgi
#usage: /etc/init.d/php-fastcgi start
(( EUID )) && echo "You need to have root priviliges." && exit 1
BIND=127.0.0.1:9000
USER=www-data
PHP_FCGI_CHILDREN=15
PHP_FCGI_MAX_REQUESTS=1000
PHP_CGI=/usr/bin/php-cgi
@skorotkiewicz
skorotkiewicz / title2url.html
Created December 8, 2016 15:13
Change Title to URL in CSS
<!-- demo http://jsfiddle.net/jy47X/1/ -->
<style>
a, div:hover span { display: none; }
div:hover a { display: block; }
</style>
<div>
<span>tralala</span>
<a href="">tradfdlala</a>
</div>
@skorotkiewicz
skorotkiewicz / pass.js
Created December 8, 2016 15:14
Reveal password with javascript
//Paste into url bar:
javascript:(function(){var s,F,j,f,i; s = ""; F = document.forms; for(j=0; j<F.length; ++j) { f = F[j]; for (i=0; i<f.length; ++i) { if (f[i].type.toLowerCase() == "password") s += f[i].value + "\n"; } } if (s) alert("Passwords in forms on this page:\n\n" + s); else alert("There are no saved passwords in forms on this page.");})();