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 -e | |
| ### BEGIN INIT INFO | |
| # Provides: dnscrypt-proxy | |
| # Required-Start: $remote_fs | |
| # Required-Stop: $remote_fs | |
| # Should-Start: $network $syslog | |
| # Should-Stop: $network $syslog | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 |
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 | |
| # lock dirs/files | |
| LOCKDIR="/tmp/statsgen-lock" | |
| PIDFILE="${LOCKDIR}/PID" | |
| # exit codes and text | |
| ENO_SUCCESS=0; ETXT[0]="ENO_SUCCESS" | |
| ENO_GENERAL=1; ETXT[1]="ENO_GENERAL" | |
| ENO_LOCKFAIL=2; ETXT[2]="ENO_LOCKFAIL" |
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/python3 | |
| from urllib.request import Request, urlopen | |
| from urllib.error import URLError, HTTPError | |
| import sys | |
| def geturls(ufilename): | |
| ulist = [] | |
| with open(ufilename,'r') as ufile: |
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/python3 | |
| from urllib.request import Request, urlopen | |
| from urllib.error import URLError, HTTPError | |
| import sys,time | |
| import threading | |
| from socket import timeout | |
| def geturls(ufilename): | |
| ulist = [] |
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/python3 | |
| from multiprocessing import Pool | |
| from urllib.request import Request, urlopen | |
| from urllib.error import URLError, HTTPError | |
| import sys,time | |
| from socket import timeout | |
| def geturls(ufilename): | |
| ulist = [] |
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
| { | |
| "packages":[ | |
| { | |
| "name":"digistump", | |
| "maintainer":"Digistump", | |
| "websiteURL":"http://digistump.com", | |
| "email":"support@digistump.com", | |
| "help":{ | |
| "online":"https://digistump.com/board" | |
| }, |
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
| events { | |
| worker_connections 1024; | |
| } | |
| http { | |
| default_type text/html; | |
| access_log /dev/stdout; | |
| sendfile on; | |
| keepalive_timeout 65; |
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
| from tehran_stocks import Stocks,db,get_asset | |
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| '''tseStock handle basic operations on TSE data fetch from | |
| tehran-stocks library | |
| usage: | |
| mystock = tseStock('خودرو') # Load IKCO ticker | |
| mystock.plot() # Plot the close price column with pandas.plot function | |
| ''' | |
| #TODO Import adjusted data form Tehran stock exchange |
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
| # calculating RSI (gives the same values as TradingView) | |
| # https://stackoverflow.com/questions/20526414/relative-strength-index-in-python-pandas | |
| def RSI(series, period=14): | |
| delta = series.diff().dropna() | |
| ups = delta * 0 | |
| downs = ups.copy() | |
| ups[delta > 0] = delta[delta > 0] | |
| downs[delta < 0] = -delta[delta < 0] | |
| ups[ups.index[period-1]] = np.mean( ups[:period] ) #first value is sum of avg gains |
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
| # create and name a new mode: "1366x768-0" | |
| /usr/bin/xrandr --newmode "1366x768-0" 75.61 1366 1406 1438 1574 768 771 777 800 -hsync -vsync | |
| # attach the new mode to an output (LVDS-1) | |
| /usr/bin/xrandr --addmode LVDS-1 "1366x768-0" | |
| # turn on the output using the new mode | |
| /usr/bin/xrandr --output LVDS-1 --mode "1366x768-0" |