This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?PHP | |
function simsimi($tresc) { | |
$curl = curl_init(); if (!$curl) exit; | |
$headers = array( | |
'Accept: application/json, text/javascript, */*; q=0.01', | |
'Content-type: application/json; charset=utf-8', | |
'Referer: http://www.simsimi.com/talk.htm', | |
'User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; pl; rv:1.9.2.13) Gecko/20101203 Firefox/3.5.13', | |
'Cookie: sagree=true; JSESSIONID=9EC7D24A64808F532B1287FFDDCDEC44', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int carRed = 12; // assign the car lights | |
int carYellow = 11; | |
int carGreen = 10; | |
int pedRed = 8; // assign the pedestrian lights | |
int pedGreen = 9; | |
int button = 2; // button pin | |
int crossTime = 5000; // time allowed to cross | |
unsigned long changeTime; // time since button pressed | |
void setup() { | |
pinMode(carRed, OUTPUT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
long randNumber; | |
void setup() { | |
DDRB = B11111111; | |
DDRD = B11111100; | |
} | |
void loop() | |
{ | |
for(int fadeValue = 0; fadeValue <= 255; fadeValue +=5) { | |
analogWrite(11, fadeValue); | |
delay(30); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
set_time_limit(0); | |
$socketMain = socket_create(AF_INET, SOCK_STREAM, 0) or die(); | |
socket_set_option($socketMain, SOL_SOCKET, SO_REUSEADDR, 1) or die(); | |
socket_bind($socketMain, '127.0.0.1', '1234') or die(); | |
socket_listen($socketMain, 5) or die(); | |
$clients = array(); | |
while(true){ | |
$read = array(); | |
$read[0] = $socketMain; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
array( | |
"AX"=>"land Islands", | |
"AF"=>"Afghanistan", | |
"AL"=>"Albania", | |
"DZ"=>"Algeria", | |
"AS"=>"American Samoa", | |
"AD"=>"Andorra", | |
"AO"=>"Angola", | |
"AI"=>"Anguilla", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- version: 1.3 (2013/12/01) - added lines: 46-51 (animated version) --> | |
<!-- version: 1.2 (2013/01/28) - edited line: 41 (added .stop) --> | |
<!-- ---------- HTML ---------- --> | |
.. | |
<header> | |
... | |
<nav>..</nav> | |
... | |
</header> | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while [[ $(date +%Y) -ne 2013 ]];do figlet $(($(date -d 2013-01-01 +%s)-$(date +%s)));sleep 1;clear;done;figlet 'Happy New Year!' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you don't remember the MySql root user's password, you can use this tip: | |
root@server:~# mysql -u root -p | |
Enter password: | |
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) | |
1) Debian has an user for manteinance jobs on mysql, and the credentials are saved on a file: | |
root@server:~# cat /etc/mysql/debian.cnf | |
# Automatically generated for Debian scripts. DO NOT TOUCH! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#Install: save code to /usr/bin/screenshot | |
#Usage: $ screenshot 5 | |
# five for 5sec countdown | |
if [ $1 ] | |
then | |
scrot -cd $1 "%Y-%m-%d_`echo $(date +%H-%m-%S)`.png" -e 'mv $f /home/modinfo/shots/' | |
echo "Screenshot save in: /home/modinfo/shots/`echo $(date +%Y-%m-%d_%H-%m-%S)`.png" | |
else | |
scrot "%Y-%m-%d_`echo $(date +%H-%m-%S)`.png" -e 'mv $f /home/modinfo/shots/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# How to install? | |
# nano /usr/bin/md5 | |
# copy&paste this code to /usr/bin/md5 | |
# chmod +x /usr/bin/md5 | |
if [ $1 ] | |
then | |
hash="$(echo -n "$1" | md5sum )" | |
echo "$hash" | |
else |