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/bash | |
| if [ $1 ] | |
| then | |
| echo "Setting timer for $1 minutes"; | |
| DELAY=$(echo "scale=4; $1*60+1" | bc) | |
| DTS=$(date +%H:%M:%S) | |
| (sleep $DELAY; notify-send "TeaHelper by Vodolaz095" "$DTS : Tea is ready!") & | |
| else | |
| echo 'Enter how many minutes to wait for tea to be ready' |
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
| function fib(x){ | |
| if(x>=0){ | |
| switch(x){ | |
| case 0: | |
| return 1; | |
| break; | |
| case 1: | |
| return 1; | |
| break; | |
| default: |
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/bash | |
| if [ ! -f ~/.rednotebook/recent.lock ]; then | |
| echo 'Pulling from remote repo...' | |
| cd ~/.rednotebook/data | |
| git pull | |
| touch ~/.rednotebook/recent.lock | |
| else | |
| echo 'Pushing to remote repo...' | |
| cd ~/.rednotebook/data |
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
| var crypto = require('crypto'); | |
| console.log(crypto.getHashes()); |
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 | |
| #cjdroute(https://github.com/cjdelisle/cjdns) install script for Fedora 20 linux | |
| cd /home/vodolaz095/projects/cjdns | |
| git checkout master | |
| git pull | |
| echo 'Source code pulled!' | |
| /home/vodolaz095/projects/cjdns/do | |
| su -c 'rm -f /bin/cjdroute; |
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 | |
| ssh-keygen -q -f /etc/ssh/ssh_host_key -N '' -t rsa1 | |
| ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa | |
| ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa | |
| ssh-keygen -f /etc/ssh/ssh_host_ecdsa_key -N '' -t ecdsa -b 521 |
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
| function filter($a,$ajax=false) | |
| { | |
| /* | |
| *Filter text messages created by ajax post request to mysql insertions, also all malicious tags (scripts, frames et cetera are removed) | |
| */ | |
| if ($ajax) $a=iconv('UTF-8','WINDOWS-1251',urldecode($a)); | |
| $a=trim($a); | |
| $a=preg_replace('~<script.*>.*</script>~im',NULL,$a); |
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
| 'use strict'; | |
| var express = require('express'); | |
| var app = express(); | |
| app.get('/1pixel.jpg', function(req,res){ | |
| var | |
| hex1pixeljpeg = 'ffd8ffe000104a46494600010101006000600000ffe1001645786966000049492a0008000000000000000000ffdb00430001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101ffdb00430101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101ffc00011080001000103012200021101031101ffc400150001010000000000000000000000000000000affc40014100100000000000000000000000000000000ffc40014010100000000000000000000000000000000ffc40014110100000000000000000000000000000000ffda000c03010002110311003f00bf8001ffd9', | |
| buffer1PixelJpeg = new Buffer(hex1pixeljpeg, 'hex'); |
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
| DATE=`date +%Y-%m-%d--%H-%M-%S` | |
| YaDiskLogin="myName@yandex.ru" | |
| yaDiskPassword="myPass" | |
| MySQLLogin="root" | |
| MySQLPassword="SecReT" | |
| MySQLDB="MyDB" | |
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
| var mysql = require('mysql'); | |
| var connection = mysql.createConnection({ | |
| host : 'example.org', | |
| user : 'bob', | |
| password : 'secret', | |
| }); | |
| connection.query('SELECT * FROM `tbl` ORDER BY `id` DESC', function(err, rows) { | |
| console.log(JSON.stringify(rows)); | |
| }); |
OlderNewer