Xvfb :99 &
export DISPLAY=:99
ruby headless.rb
This file contains 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
# based on: | |
# https://stackoverflow.com/a/882770/2237916 | |
# https://stackoverflow.com/a/53970596/2237916 | |
import smtplib | |
from email.mime.application import MIMEApplication | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
from os.path import basename |
This file contains 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
import pandas_datareader as pdr | |
import matplotlib.pyplot as plt | |
from statsmodels.tsa.arima_model import ARIMA | |
from scipy.signal import find_peaks | |
data = pdr.get_data_yahoo("FR.PA") | |
data_ = data[data.index>"2017"] | |
# find_peaks(data_["Volume"]) |
This file contains 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
\documentclass{article} | |
\usepackage{listings} | |
\input{listings-python.prf} % defines the python-idle-code style | |
\usepackage{textcomp} % Needed for straight quotes | |
\lstset{ | |
basicstyle=\normalsize\ttfamily, % size of the fonts for the code | |
language={Python},style={python-idle-code}, | |
showstringspaces=false, |
This file contains 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
sudo vi /etc/tor/torrc | |
#ControlPort 9051 | |
ControlPort 9051 | |
#CookieAuthentication 1 | |
CookieAuthentication 0 | |
sudo service tor restart | |
echo -e 'AUTHENTICATE ""\r\nsignal NEWNYM\r\nQUIT' | nc 127.0.0.1 9051 |
This file contains 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
db.t4.insert({ | |
"_id" : ObjectId("512e28984815cbfcb21646a7"), | |
"list" : [ | |
{ | |
"a" : ISODate("2012-12-19T06:01:17.171Z"), | |
"b" : 5 | |
}, | |
{ | |
"a" : ISODate("2013-12-19T06:01:17.171Z"), | |
"b" : 5 |
Scan devices
hcitool scan
From: https://askubuntu.com/a/450751/269279 We can nicely control our Bluetooth device with the command line tool [hciconfig][1].
To enable visibility:
This file contains 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
import time | |
# from dateutil import parser | |
import requests | |
import pandas as pd | |
url = 'http://google.com' | |
try: | |
response = requests.get(url) | |
except Exception: |
This file contains 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
import zmq | |
import sys | |
context = zmq.Context() | |
print "Connecting to server..." | |
socket = context.socket(zmq.REQ) | |
socket.connect ("ipc://test_hello") | |
This file contains 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
# code to solve https://stackoverflow.com/q/47932589/2237916 | |
import numpy as np | |
import tflearn | |
from random import shuffle | |
# parameters | |
n_input=100 | |
n_train=2000 | |
n_test = 500 | |
# generate data |