Skip to content

Instantly share code, notes, and snippets.

@thocell
thocell / r_ubuntu_18_04.sh
Created September 8, 2019 08:48 — forked from ElToro1966/r_ubuntu_18_04.sh
Install R and RStudio on Ubuntu 18.04 with essential libraries for data science. Based on pachamaltese/r_ubuntu_17_10.sh (for Ubuntu 17.10). Note: You need to make sure the default library location - /usr/local/lib/R/site-packages - is writable .
# Install R
sudo apt update
sudo apt install gdebi libxml2-dev libssl-dev libcurl4-openssl-dev libopenblas-dev r-base r-base-dev
# Install RStudio
cd ~/Downloads
wget https://download1.rstudio.org/rstudio-xenial-1.1.447-amd64.deb
sudo gdebi rstudio-xenial-1.1.447-amd64.deb
printf '\nexport QT_STYLE_OVERRIDE=gtk\n' | sudo tee -a ~/.profile
@thocell
thocell / PHP-CURL-Tor-Tutorial.md
Created July 27, 2019 00:17 — forked from megaxorg/PHP-CURL-Tor-Tutorial.md
PHP: CURL Requests with Tor

#CURL Connections with Tor

Install Apache, PHP, CURL & Tor with apt-get

sudo apt-get install -y apache2 php5 php5-curl tor

Tor creates a proxy on your mashine with port 9050 for SOCKS5 connections.

@thocell
thocell / getheaders.php
Created June 29, 2018 14:09
get header info by php
function getFileInfo($url){
$ch = curl_init($url);
curl_setopt( $ch, CURLOPT_NOBODY, true );
curl_setopt( $ch, CURLOPT_HEADER, false );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, false );
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt( $ch, CURLOPT_MAXREDIRS, 3 );
curl_exec( $ch );
$headerInfo = curl_getinfo( $ch );
curl_close( $ch );
@thocell
thocell / Subtitle Downloader for youtube, ted, vimeo, dramafever and more. Auto subtitle supported.
Created June 24, 2018 19:53
Download subtitles or captions from Youtube, TED, Vimeo, Dramafever, Dailymotion, etc. Support mutiple languages. For Youtube, both closed captions (CC) and automatic captions (auto-generated subtitles) can be downloaded if they are available. Fast and easy to use.
// ==UserScript==
// @name Best Subtitle Downloader for youtube, ted, vimeo, dramafever and more. Auto subtitle supported.
// @namespace https://distillvideo.com/
// @version 2.1
// @date 2018-06-23
// @description Download subtitles or captions from Youtube, TED, Vimeo, Dramafever, Dailymotion, etc. Support mutiple languages. For Youtube, both closed captions (CC) and automatic captions (auto-generated subtitles) can be downloaded if they are available. Fast and easy to use.
// @author DistillVideo.com
// @copyright 2018, DistillVideo.com
// @homepage https://distillvideo.com/page/extensions
// @compatible chrome
@thocell
thocell / Video_Audio_Downloader.js
Last active November 17, 2024 17:40
The Tampermonkey userscript to download video and audio from Youtube, Twitter, Vimeo, Facebook, Dailymotion, 1tv, VK, youku, bilibili and 5000 more sites for free. Fast and easy to use.
// ==UserScript==
// @name Distill Video & Audio Downloader from 5000+ sites including Youtube, Support 1080P, 2K, 4k & 8K
// @namespace https://distillvideo.com/
// @version 2.1.1
// @date 2018-06-17
// @description Browser extension to download video and audio from Youtube, Twitter, Vimeo, Facebook, Dailymotion, 1tv, VK, youku, bilibili and 5000 more sites for free. Fast and easy to use.
// @author DistillVideo.com
// @copyright 2018, DistillVideo.com
// @homepage https://distillvideo.com/page/extensions
// @downloadURL https://distillvideo.com/js/ditillvideo.user.js
@thocell
thocell / ditillvideo.user.js
Last active June 11, 2018 10:22
Browser extension to download youtube videos
// ==UserScript==
// @name DistillVideo Downloader
// @namespace https://distillvideo.com/
// @version 1.0
// @description Browser extension to download videos
// @author DistillVideo
// @copyright 2018, DistillVideo
// @homepage https://distillvideo.com/page/extensions
// @downloadURL https://distillvideo.com/js/ditillvideo.user.js
// @match *://*.youtube.com/*
@thocell
thocell / get_headers_alternative.php
Last active May 13, 2018 11:52
Get headers using curl--php
* In php, the function "get_headers" sometimes is slow, especially if you want to get headers of a batch of urls in parallel.
* In this case, you should use curl.
function get_headers_curl($url){
$curl = curl_init();
curl_setopt_array( $curl, array(
CURLOPT_HEADER => true,
CURLOPT_NOBODY => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_URL => $url));
@thocell
thocell / youtube-dl-python-3.6
Last active April 10, 2020 16:19
Force youtube-dl to use python 3.6
Since python 2.x will be deprecated in 2020, it is better to use python 3.x for youtube-dl.
Plus, python 3.6 runs faster. But for ubuntu, normaly, youtube-dl just uses python 2.x.
Here is how to force youtube-dl to use python 3.6.
*1.Install python3.6 according to this gist:
https://gist.github.com/thodison/3dfcff7d09560357c9c6a9b453e0d6ed
*2.Edit ~/.bashrc
Add the folloing line on the top, then save and close it:
alias python3="python3.6"
@thocell
thocell / Install_python3.6.4
Last active May 11, 2018 13:36
Install python 3.6.4 on ubuntu 14.04
****
* For the Ubuntu 14.04 system, it is not easay to install python 3.6 and make pip3 work using the python3.6.4 path. If installed from the repository with ppa:jonathonf/python-3.6,
* there are always problems to use pip3 to call python 3.6.4. So this gist will help to solve such problems.
******
sudo apt-get install build-essential checkinstallsudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
cd ~
sudo wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz
sudo tar xzf Python-3.6.4.tgz
@thocell
thocell / 5 cheap (less than $5) and reliable vps comparison and how to earn $25 for free.md
Last active April 15, 2024 04:25
A comparison between 5 cheap VPS providers with plans below $5 per month and how to earn $25 for free.

Here is a basic comparison between 5 reliable and cheap VPS providers with plans below $5 per month.

VPS Companies


OVH Linode DigitalOcean Scaleway Vultr
Foundation 1999 2003 2011 2013 2014
Headquarters Roubaix (FR) Galloway, NJ (US) New York (US) Paris (FR) Matawan, NJ (US)