Archive

Archive for the ‘Uncategorized’ Category

TigerVPN Lite: Lifetime Subscription for 29$

26/09/2015 1 comment

TigerVPN Lite offer:

  • Provides top-notch security
  • Encrypts all your browsing w/ a 256bit SSL encryption
  • Includes 10Gbps servers optimized to limit latency globally
  • Offers access to 15 nodes (of the 61 available) covering 41 countries & 5 continents
  • Doesn’t limit your data; plus bandwidth health detection maintains performance at peak times
  • Includes easy-to-use mobile apps
  • Allows for a choice in encryption protocol – PPTP, L2TP, OpenVPN, etc.

Tiger VPN Lifetime subscription for $29

Categories: Uncategorized

Godziny otwarcia basenu w Malborku

24/09/2015 Leave a comment

Poniedziałek: 7:00, 13:35 , 20:45
Wtorek: 7:00
Środa: 7:00, 13:35
Czwartek: 7:00, 14:30, 20:45
Piątek: 7:00, 14:30
Sobota: 13:00, 14:00, 15:00, 16:00, 17:00
Niedziela: 13:00, 14:00, 15:00, 16:00, 17:00

Stan na 2015-10-06

Categories: Uncategorized

Adobe presets for GoPro footage

23/09/2015 Leave a comment

Blur and Sharpen:
Sharpen 50

Color Correction:
Brightness 15
Contrast 20

Image Control:
Gamma 14

Difference:
dinopark.mp4_snapshot_00.07_[2015.09.23_21.45.32]

Categories: Uncategorized

Rename files based on their creation date

19/10/2014 1 comment


#!/bin/bash
for i in Filmy/*.mp4
do
mod_date=$(stat -c "%y" "$i"|sed 's/\..*$//'|sed 's/\ /\_/'|tr -d ':'|tr -d '-')
mv "$i" "$mod_date".MP4
done

Categories: Uncategorized

How to download “past broadcasts” from twitch.tv

08/08/2013 2 comments

Unfortunately justin api no longer support twitch.tv channels and new twitch api doesn’t show direct links for flv videos. But fortunately we can still use listing by archive id using this url:
http://api.justin.tv/api/broadcast/by_archive/yyyyyyyyy.json

So, lets adopt our previous source to get fully working code in php witch download all videos from our favorite twitch channel:

<?php
$url = "https://api.twitch.tv/kraken/channels/xxxxxxx/videos?limit=100&broadcasts=true";

$c = curl_init($url);
$options = array(
	CURLOPT_RETURNTRANSFER => true,
	CURLOPT_HTTPHEADER => array('Content-type: application/json'),
	CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_SSL_VERIFYHOST => 2
);
curl_setopt_array( $c, $options );
$json = curl_exec($c);
$json_a = json_decode($json,true);

foreach($json_a['videos'] as $v) {
	$id = $v['_id'];
	$id = preg_replace('/[^0-9.]+/', '', $id);
	if(!history_check($id)){
		$vid = "http://api.justin.tv/api/broadcast/by_archive/$id.json";
		$d = curl_init($vid);
		$options2 = array(
			CURLOPT_RETURNTRANSFER => true,
			CURLOPT_HTTPHEADER => array('Content-type: application/json')
		);
		curl_setopt_array( $d, $options2 );
		$json2 = curl_exec($d);
		$json2_a = json_decode($json2,true);
		exec('wget --progress=dot:mega -c '.$json2_a[0]['video_file_url'].' -O "downloads/'.$json2_a[0]['start_timestamp'].' - '.format_title($json2_a[0]['title']).'.flv"', $array,$exit_code);
		echo 'Exit code: '.$exit_code."\n";
		echo $array;
		echo "\n";
		history_add($id);
		echo implode('"\n"', $array);
	}
}

function format_title($title){ //format title and limit to 50 chars
	$out = preg_replace('/[^a-zA-Z \.]/','', $title);
	$out = substr($out, 0, 50); 
	return $out;
}
function history_check($date){
	$data = file_get_contents('history');

	if(strpos($data, $date) !== FALSE)
	{
		$out = TRUE;
	}
	else
	{
		$out = FALSE;
	}
return $out;
}

function history_add($date){
	file_put_contents('history', $date."\n", FILE_APPEND);
}
?>
Categories: Uncategorized

Import CVS data to MySQL table

12/01/2013 Leave a comment

Import OpenGEO csv file into mysql.

Table structure:

id	int(11) Auto Increment	 
ip_start	int(11)	 
ip_end	int(11)	 
miasto	text	 
powiat	text	 
wojewodztwo	text

File structure:

"IP START","IP END","MIASTO","POWIAT","WOJEWÓDZTWO"
522815488,522817535,"Wieluń","wieluński","Łódzkie"
(...)

MySQL command:

mysql> load data local infile '/home/user/opengeo.csv' into table opengeo fields terminated by ',' enclosed by '"' lines terminated by '\n' (ip_start, ip_end, miasto, powiat, wojewodztwo);
Query OK, 71513 rows affected, 4594 warnings (0.56 sec)
Records: 71513  Deleted: 0  Skipped: 0  Warnings: 4592
Categories: Uncategorized

How to use rm with exclude in curent dir

12/02/2012 Leave a comment

find . -maxdepth 1 | grep -v “dont_delete_this” | xargs rm

Categories: Uncategorized