Last active
July 7, 2021 00:36
-
-
Save theagoliveira/5f703be59a31b07e2fc8541abf7ae0bb to your computer and use it in GitHub Desktop.
Old/outdated code
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
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
#!/usr/bin/zsh | |
URLSTART="http://www.thebrokentoken.com/content/instructions/" | |
URLEND="_Instructions.pdf" | |
for i in {000..020} | |
do | |
for j in {ACC,GCA,DIT,TCH,HBY} | |
wget "$URLSTART$j$i$URLEND" | |
done | |
k="ORG" | |
for i in {000..100} | |
do | |
wget "$URLSTART$k$i$URLEND" | |
done |
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
# Trying to implement DFT using python | |
import cmath | |
def dft(v): | |
n = len(v) | |
V = [0]*n | |
for i in range(n): | |
for j in range(n): | |
V[i] += v[j]*cmath.exp(-1j*2*cmath.pi*i*j/n) | |
return V | |
def idft(V): | |
n = len(V) | |
v = [0]*n | |
for i in range(n): | |
for j in range(n): | |
v[i] += V[j]*cmath.exp(1j*2*cmath.pi*i*j/n)/n | |
return v | |
def dft_ct(v): | |
primes = [2, 3, 5, 7, 11, 13] | |
n = len(v) | |
if n == 1: | |
return v | |
elif n in primes: | |
return dft(v) | |
else: | |
for elem in primes: | |
if (n % elem) == 0: | |
na = elem # rows | |
break | |
nb = n // na # columns | |
r_na = range(na) | |
r_nb = range(nb) | |
arr = [dft_ct([v[nb*a + b] for a in r_na]) for b in r_nb] | |
arr = [dft_ct([arr[b][a]*cmath.exp(-1j*2*cmath.pi*a*b/n) for b in r_nb]) for a in r_na] | |
return [arr[a][b] for b in r_nb for a in r_na] | |
def idft_ct(V): | |
primes = [2, 3, 5, 7, 11, 13] | |
n = len(V) | |
if n == 1: | |
return V | |
elif n in primes: | |
return idft(V) | |
else: | |
for elem in primes: | |
if (n % elem) == 0: | |
na = elem # rows | |
break | |
nb = n // na # columns | |
r_na = range(na) | |
r_nb = range(nb) | |
arr = [idft_ct([V[nb*a + b] for a in r_na]) for b in r_nb] | |
arr = [idft_ct([arr[b][a]*cmath.exp(1j*2*cmath.pi*a*b/n) for b in r_nb]) for a in r_na] | |
return [arr[a][b] for b in r_nb for a in r_na] | |
def dft_2d(v): | |
n = len(v) | |
m = len(v[0]) | |
V = [[0]*m for _ in range(n)] | |
for k in range(n): | |
for l in range(m): | |
for i in range(n): | |
for j in range(m): | |
V[k][l] += (1/(n*m))*v[i][j]*cmath.exp(-1j*2*cmath.pi*(((k*i)/n) + ((l*j)/m))) | |
return V | |
def idft_2d(V): | |
n = len(V) | |
m = len(V[0]) | |
v = [[0]*m for _ in range(n)] | |
for k in range(n): | |
for l in range(m): | |
for i in range(n): | |
for j in range(m): | |
v[k][l] += V[i][j]*cmath.exp(1j*2*cmath.pi*(((k*i)/n) + ((l*j)/m))) | |
return v | |
def dft_2d_ct(v): | |
n = len(v) | |
m = len(v[0]) | |
V = list(map(dft_ct,v)) | |
V = [[V[a][b] for a in range(n)] for b in range(m)] | |
V = list(map(dft_ct,V)) | |
return [[(1/(n*m))*V[a][b] for a in range(m)] for b in range(n)] | |
def idft_2d_ct(V): | |
n = len(V) | |
m = len(V[0]) | |
v = [[V[a][b]*(n*m) for a in range(n)] for b in range(m)] | |
v = list(map(idft_ct,v)) | |
v = [[v[a][b] for a in range(m)] for b in range(n)] | |
return list(map(idft_ct,v)) | |
def print_complex_array(a): | |
print("[",end="") | |
for x in a[:-1]: | |
print('({0.real: #09.2f} + {0.imag: #09.2f}j)'.format(x),", ",sep="",end="") | |
print('({0.real: #09.2f} + {0.imag: #09.2f}j)'.format(a[-1]),"]",sep="",end="\n") | |
def print_complex_array_abs(a): | |
print("[",end="") | |
for x in a[:-1]: | |
print("{0:0.2f}".format(abs(x)),", ",sep="",end="") | |
print("{0:0.2f}".format(abs(a[-1])),"]",sep="",end="\n") |
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
#!/usr/bin/env python | |
""" | |
TODO | |
""" | |
from splinter import Browser | |
__author__ = 'Thiago Cavalcante' | |
with Browser() as browser: | |
url = "http://www.smttmaceio.com.br/portal/servicos/linhas.jsf" | |
browser.visit(url) | |
browser.fill('frmLinha:j_id_jsp_184052151_7', '') | |
button = browser.find_by_name('frmLinha:j_id_jsp_184052151_8') | |
print(button.value) | |
button.click() | |
button = browser.find_by_tag('td')[84] # PAGE 2 | |
print(button.value) | |
button.click() | |
if browser.is_text_present('A', wait_time=2): | |
print("Yes") | |
else: | |
print("No") | |
button = browser.find_by_tag('td')[85] # PAGE 3 | |
print(button.value) | |
button.click() | |
if browser.is_text_present('A', wait_time=2): | |
print("Yes") | |
else: | |
print("No") | |
button = browser.find_by_tag('td')[86] # PAGE 4 | |
print(button.value) | |
button.click() | |
if browser.is_text_present('A', wait_time=2): | |
print("Yes") | |
else: | |
print("No") | |
button = browser.find_by_tag('td')[87] # PAGE 5 | |
print(button.value) | |
button.click() | |
if browser.is_text_present('A', wait_time=2): | |
print("Yes") | |
else: | |
print("No") | |
button = browser.find_by_tag('td')[88] # PAGE 6 | |
print(button.value) | |
button.click() | |
if browser.is_text_present('A', wait_time=2): | |
print("Yes") | |
else: | |
print("No") |
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 | |
# | |
# Author: Thiago Cavalcante | |
# github.com/theagoliveira | |
# SOURCE: https://askubuntu.com/questions/395150/how-can-i-extract-all-pdf-links-on-a-website | |
# NAME: pdflinkextractor | |
# AUTHOR: Glutanimate (http://askubuntu.com/users/81372/), 2013 | |
# LICENSE: GNU GPL v2 | |
# DEPENDENCIES: wget lynx | |
# DESCRIPTION: extracts PDF links from websites and dumps them to the stdout | |
# and as a textfile only works for links pointing to files with | |
# the ".pdf" extension | |
# | |
# USAGE: pdflinkextractor "www.website.com" | |
WEBSITE="$1" | |
echo "Getting link list..." | |
lynx -cache=0 -dump -listonly "$WEBSITE" | grep ".*pdf$" | awk '{print $2}' | tee pdflinks.txt | |
# OPTIONAL: DOWNLOAD PDF FILES | |
echo "Downloading..." | |
wget -P pdflinkextractor_files/ -i pdflinks.txt | |
# FUTURE INTERNET (2013-2018) | |
for A in {5..10} | |
do | |
for B in {1..4} | |
do | |
lynx -cache=0 -dump -listonly "http://www.mdpi.com/1999-5903/$A/$B" | grep ".*pdf$" | awk '{print $2}' | tee pdflinks.txt | |
# SOURCE: https://www.experts-exchange.com/articles/13964/A-Simple-Linux-script-to-retrieve-information-from-the-web-using-xpath-selection.html | |
wget -q -O - "http://www.mdpi.com/1999-5903/$A/$B" | xmllint --html --xpath '//a[@class = "title-link"]' - 2>/dev/null | |
done | |
done | |
# JOURNAL OF CYBER SECURITY AND MOBILITY (2013-2017) | |
for A in {2..6} | |
do | |
for B in {1..4} | |
do | |
lynx -cache=0 -dump -listonly "http://www.riverpublishers.com/journal.php?j=JCSM/$A/$B/undefine" | grep ".*\.pdf$" | awk '{print $2}' | tee -a pdflinks.txt | |
done | |
done | |
for A in {2..6} | |
do | |
for B in {1..4} | |
do | |
# SOURCE: https://www.experts-exchange.com/articles/13964/A-Simple-Linux-script-to-retrieve-information-from-the-web-using-xpath-selection.html | |
wget -q -O - "http://www.riverpublishers.com/journal.php?j=JCSM/$A/$B/undefine" | xmllint --html --xpath '//div[@id = "jauthorbox"]/font[@color="#006400"]/b' - 2>/dev/null | |
done | |
done |
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
; Command: Ctrl + Alt + C | |
; | |
; Description: On Chrome, copy URL from the next tab, close the tab, go to the | |
; previous tab (which is a Google Docs Spreadsheet), and insert an hyperlink | |
; with the copied URL. This command assumes the cell already has the hyperlink | |
; text. | |
; | |
^!c:: | |
Send, {Ctrl down}{Tab}{Ctrl up} ; Next tab | |
Sleep, 100 | |
Send, {Alt down}d{Alt up} ; Select address bar | |
Sleep, 50 | |
Send, {Alt down}d{Alt up} ; Select address bar | |
Sleep, 300 | |
Send, {Ctrl down}c{Ctrl up} ; Copy URL | |
Send, {Ctrl down}w{Ctrl up} ; Close tab | |
Send, {Ctrl down}+{Tab}{Ctrl up} ; Go to previous tab | |
Sleep, 200 | |
Send, {Ctrl down}k{Ctrl up} ; Insert hyperlink | |
Sleep, 200 | |
Send, {Ctrl down}v{Ctrl up} ; Paste URL | |
Sleep, 200 | |
Send, {Enter} ; Confirm | |
Return | |
; Command: Ctrl + Shift + Alt + C | |
; | |
; Description: On Chrome, copy URL from the next tab, close the tab (you should | |
; land on a Google Docs Spreadsheet tab), and insert an hyperlink with the | |
; copied URL. This command assumes the cell already has the hyperlink text. | |
; | |
^+!c:: | |
Send, {Ctrl down}{Tab}{Ctrl up} ; Next tab | |
Sleep, 100 | |
Send, {Alt down}d{Alt up} ; Select address bar | |
Sleep, 50 | |
Send, {Alt down}d{Alt up} ; Select address bar | |
Sleep, 300 | |
Send, {Ctrl down}c{Ctrl up} ; Copy URL | |
Send, {Ctrl down}w{Ctrl up} ; Close tab | |
Sleep, 200 | |
Send, {Ctrl down}k{Ctrl up} ; Insert hyperlink | |
Sleep, 200 | |
Send, {Ctrl down}v{Ctrl up} ; Paste URL | |
Sleep, 200 | |
Send, {Enter} ; Confirm | |
Return | |
; Command: Ctrl + Alt + O | |
; | |
; Description: On Chrome, on a Google Docs Spreadsheet tab, open a column of | |
; 8 hyperlinks (open link, return to spreadsheet, open next link etc.) | |
; | |
^!o:: | |
Loop, 7 | |
{ | |
Send, {Alt down}{enter}{Alt up} ; Open hyperlink | |
Sleep, 700 | |
Send, {Ctrl down}+{Tab}{Ctrl up} ; Go to previous tab | |
Sleep, 100 | |
Send, {Down} | |
Sleep, 50 | |
} | |
Send, {Alt down}{enter}{Alt up} ; Open hyperlink | |
Sleep, 700 | |
Send, {Ctrl down}+{Tab}{Ctrl up} ; Go to previous tab | |
Return | |
; Command: Ctrl + Alt + R | |
; | |
; Description: On Steam website, remove an item from wishlist | |
; | |
^!r:: | |
Loop, 5 | |
{ | |
Send, {Tab} | |
} | |
Sleep, 100 | |
Send, {Enter} | |
Return |
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 | |
read -p "UPDATE/UPGRADE AND INSTALL BASIC PACKAGES (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
sudo apt install exfat-utils exfat-fuse gparted terminator apt-transport-https | |
sudo apt update | |
sudo apt upgrade | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
;; | |
* ) | |
;; | |
esac | |
read -p "MAKE LINUX USE LOCAL TIME (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
timedatectl set-local-rtc 1 | |
;; | |
* ) | |
;; | |
esac | |
############################################################################### | |
read -p "AUTO MOUNT FILES PARTITION (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
sudo blkid | |
sudo gparted # FORMAT AND ADD LABEL "Files" IF NECESSARY | |
read -p "UUID: " UUID | |
read -p "FOLDER: " FOLD # ex.: /media/thiago/Files | |
read -p "FORMAT: " FRMT # ex.: ext4, ntfs etc | |
sudo mkdir $FOLD | |
sudo sh -c "echo 'UUID=$UUID $FOLD $FRMT auto,user,rw,exec 0 2' >> /etc/fstab" | |
sudo cat /etc/fstab | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
sudo mount -a | |
sudo chown $USER:$USER $FOLD | |
;; | |
* ) | |
;; | |
esac | |
############################################################################### | |
read -p "EXTERNAL REPOSITORIES (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
# flatpak | |
sudo add-apt-repository --yes ppa:alexlarsson/flatpak | |
# grub-customizer | |
sudo add-apt-repository --yes ppa:danielrichter2007/grub-customizer | |
# inkscape | |
sudo add-apt-repository --yes ppa:inkscape.dev/stable | |
# kicad | |
sudo add-apt-repository --yes ppa:js-reynaud/kicad-4 | |
# mupdf | |
sudo add-apt-repository --yes ppa:ubuntuhandbook1/apps | |
# paper-icon-theme | |
sudo add-apt-repository --yes ppa:snwh/pulp | |
# papirus-icon-theme | |
sudo add-apt-repository --yes ppa:papirus/papirus | |
# unetbootin | |
sudo add-apt-repository --yes ppa:gezakovacs/ppa | |
# qbittorrent | |
sudo add-apt-repository --yes ppa:qbittorrent-team/qbittorrent-stable | |
# CURRENTLY NOT WORKING | |
# mosquitto | |
# sudo add-apt-repository --yes ppa:mosquitto-dev/mosquitto-ppa | |
# etcher | |
echo "deb https://dl.bintray.com/resin-io/debian stable etcher" | sudo tee /etc/apt/sources.list.d/etcher.list | |
sudo apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 379CE192D401AB61 | |
# owncloud | |
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/Ubuntu_18.04/ /' > /etc/apt/sources.list.d/isv:ownCloud:desktop.list" | |
# sublime-text | |
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add - | |
sudo apt install apt-transport-https | |
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4ABE1AC7557BEFF9 | |
# CURRENTLY NOT WORKING | |
# plexmediaserver | |
# echo deb https://downloads.plex.tv/repo/deb ./public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list | |
# curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add - | |
# CURRENTLY NOT WORKING | |
# itch | |
# curl https://dl.itch.ovh/archive.key | sudo apt-key add - | |
# ITCHIO_DEB="deb https://dl.bintray.com/itchio/deb bionic main" # Ubuntu 18.04 | |
# echo $ITCHIO_DEB | sudo tee /etc/apt/sources.list.d/itchio.list | |
sudo apt update | |
sudo apt upgrade | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
;; | |
* ) | |
;; | |
esac | |
############################################################################### | |
read -p "LINUX PACKAGES (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
sudo apt install arc-theme avahi-daemon byzanz cheese chrome-gnome-shell clang curl dconf-editor etcher-electron ffmpeg flatpak git gnome-tweak-tool gnuplot grsync grub-customizer html-xml-utils inkscape ipython ipython3 jq kicad libappindicator1 libarchive-dev libarchive-tools libc6:i386 libcanberra-gtk-module libgconf2-dev libgl1-mesa-dri:i386 libgl1-mesa-glx:i386 libindicator7 libreoffice libreoffice-style-breeze libsane libsane-extras lsb lynx mupdf mupdf-tools nodejs net-tools numix-gtk-theme numix-icon-theme numix-blue-gtk-theme openjdk-8-jdk-headless openjdk-8-jre openjdk-8-jdk openjfx owncloud-client p7zip-full paper-icon-theme pcscd pcsc-tools python-apt python-matplotlib python-pip python-pyside python-qt4 python-serial python3-pip qbittorrent screenfetch simple-scan sublime-text sane sane-utils tree vlc xdotool xsane xzdec zsh | |
# CURRENTLY NOT WORKING | |
# itch mosquitto mosquitto-clients pdftk plexmediaserver unetbootin | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
;; | |
* ) | |
;; | |
esac | |
############################################################################### | |
read -p "PYTHON PACKAGES (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
sudo pip install paho-mqtt pyqtgraph reprint | |
sudo pip3 install paho-mqtt pyqtgraph reprint | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
;; | |
* ) | |
;; | |
esac | |
############################################################################### | |
echo 'DEB APPS' | |
read -p "TUXGUITAR (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
AUX="$(curl 'https://sourceforge.net/projects/tuxguitar/best_release.json' | jq -r '.platform_releases.linux.filename')" | |
wget "http://downloads.sourceforge.net/project/tuxguitar${AUX%.tar.gz}.deb" -O tuxguitar.deb | |
sudo dpkg -i -E tuxguitar.deb | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
rm -f tuxguitar.deb | |
;; | |
* ) | |
;; | |
esac | |
read -p "ITCH.IO (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
wget $(curl 'https://api.github.com/repos/itchio/itch/releases' | jq -r '.[0].assets[].browser_download_url | select(contains("amd64.deb"))') -O itch.deb | |
sudo dpkg -i -E itch.deb | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
rm -f itch.deb | |
;; | |
* ) | |
;; | |
esac | |
read -p "PANDOC (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
wget $(curl 'https://api.github.com/repos/jgm/pandoc/releases' | jq -r '.[0].assets[].browser_download_url | select(contains("amd64.deb"))') -O pandoc.deb | |
sudo dpkg -i -E pandoc.deb | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
rm -f pandoc.deb | |
;; | |
* ) | |
;; | |
esac | |
read -p "STEAM (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
wget 'http://repo.steampowered.com/steam/archive/precise/steam_latest.deb' -O steam.deb | |
sudo dpkg -i -E steam.deb | |
echo 'RUN "LD_PRELOAD='/usr/$LIB/libstdc++.so.6 /usr/$LIB/libgcc_s.so.1 /usr/$LIB/libxcb.so.1 /usr/$LIB/libgpg-error.so' /usr/bin/steam" AND PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
rm -f steam.deb | |
;; | |
* ) | |
;; | |
esac | |
read -p "ATOM (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
wget 'https://atom.io/download/deb' -O atom.deb | |
sudo dpkg -i -E atom.deb | |
sudo curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/develop/scripts/99-platformio-udev.rules > "$HOME/Downloads/99-platformio-udev.rules" | |
sudo mv "$HOME/Downloads/99-platformio-udev.rules" "/etc/udev/rules.d/" | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
rm -f atom.deb | |
;; | |
* ) | |
;; | |
esac | |
read -p "PLEX (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
firefox https://www.plex.tv/downloads/ | |
read -p "ENTER VERSION: " VERSION | |
wget "https://downloads.plex.tv/plex-media-server/$VERSION/plexmediaserver"_"$VERSION"_"amd64.deb" -O plex.deb | |
sudo dpkg -i -E plex.deb | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
rm -f plex.deb | |
;; | |
* ) | |
;; | |
esac | |
############################################################################### | |
echo 'FLATPAK APPS' | |
read -p "GIMP (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
flatpak install https://flathub.org/repo/appstream/org.gimp.GIMP.flatpakref | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
;; | |
* ) | |
;; | |
esac | |
############################################################################### | |
echo 'SNAP APPS' | |
read -p "SPOTIFY (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
snap install spotify | |
sudo cp /var/lib/snapd/desktop/applications/spotify_spotify.desktop /usr/share/applications | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
;; | |
* ) | |
;; | |
esac | |
############################################################################### | |
echo 'PORTABLE APPS' | |
mkdir "$HOME/Apps" | |
read -p "Z (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
wget -P "$HOME/Apps/" 'https://raw.githubusercontent.com/rupa/z/master/z.sh' | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
;; | |
* ) | |
;; | |
esac | |
read -p "PUP (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
wget -qO- $(curl 'https://api.github.com/repos/ericchiang/pup/releases' | jq -r '.[0].assets[].browser_download_url | select(contains("linux_amd64"))') | bsdtar -xf- | |
sudo chmod +x pup | |
sudo mv pup /usr/local/bin/ | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
;; | |
* ) | |
;; | |
esac | |
read -p "JABREF (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
wget -O- $(curl 'https://api.github.com/repos/JabRef/jabref/releases' | jq -r '.[0].assets[].browser_download_url | select(endswith(".jar"))') > "$HOME/Apps/JabRef.jar" | |
sudo update-alternatives --config java # SELECT JAVA 8 | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
;; | |
* ) | |
;; | |
esac | |
############################################################################### | |
echo 'EXTRACTABLE APPS' | |
read -p "ARDUINO (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
mkdir "$HOME/Apps/Arduino" && wget -qO- "https://downloads.arduino.cc/arduino-$(curl 'https://api.github.com/repos/Arduino/arduino/releases' | jq -r '.[0].tag_name')-linux64.tar.xz" | tar -x -J -C "$HOME/Apps/Arduino" --strip-components 1 -f- | |
sudo usermod -a -G dialout $USER # https://askubuntu.com/questions/58119/changing-permissions-on-serial-port | |
sudo chmod +x "$HOME/Apps/Arduino/arduino" | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
;; | |
* ) | |
;; | |
esac | |
read -p "ENERGIA (y/n): " answer # WGET LINK = GAMBIARRA | |
case ${answer:0:1} in | |
y|Y ) | |
mkdir "$HOME/Apps/Energia" && wget -qO- $(curl http://energia.nu/download/ | pup 'div[class="entry-content"] p:nth-of-type(5) a attr{href}') | tar -x -J -C "$HOME/Apps/Energia" --strip-components 1 -f- | |
sudo chmod +x "$HOME/Apps/Energia/energia" | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
;; | |
* ) | |
;; | |
esac | |
read -p "PROCESSING (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
mkdir "$HOME/Apps/Processing" && wget -qO- $(curl 'https://api.github.com/repos/processing/processing/releases' | jq -r '.[0].assets[].browser_download_url | select(contains("linux64"))') | tar -x -z -C "$HOME/Apps/Processing" --strip-components 1 -f- | |
sudo chmod +x "$HOME/Apps/Processing/processing" | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
;; | |
* ) | |
;; | |
esac | |
read -p "EAGLE (AUTODESK) (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
mkdir "$HOME/Apps/Eagle" && wget -qO- eagle.tar.gz https://www.autodesk.com/eagle-download-lin | tar -x -z -C "$HOME/Apps/Eagle" --strip-components 1 -f- | |
sudo chmod +x "$HOME/Apps/Eagle/eagle" | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
;; | |
* ) | |
;; | |
esac | |
############################################################################### | |
echo 'OTHER APPS' | |
read -p "DROPBOX (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
wget -qO- "https://www.dropbox.com/download?plat=lnx.x86_64" | tar -x -z -C "$HOME" | |
wget -O dropbox.py https://www.dropbox.com/download?dl=packages/dropbox.py | |
sudo chmod +x dropbox.py | |
sudo mv dropbox.py /usr/local/bin/ | |
mkdir "$HOME/.config/autostart/" | |
printf '[Desktop Entry]\nName=Dropbox\nGenericName=File Synchronizer\nComment=Sync your files across computers and to the web\nExec=dropbox.py start\nTerminal=false\nType=Application\nIcon=dropbox\nCategories=Network;FileTransfer;\nStartupNotify=false\n' > "$HOME/.config/autostart/dropbox.desktop" | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
;; | |
* ) | |
;; | |
esac | |
read -p "JDOWNLOADER 2 (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
wget 'http://installer.jdownloader.org/JD2SilentSetup_x64.sh' -O JD2.sh | |
sudo chmod +x JD2.sh | |
./JD2.sh | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
rm -f JD2.sh | |
;; | |
* ) | |
;; | |
esac | |
read -p "CALIBRE (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.py | sudo python -c "import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main()" | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
;; | |
* ) | |
;; | |
esac | |
read -p "TEXLIVE (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
mkdir "./texlive" && wget -qO- texlive.tar.gz http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz | tar -x -z -C "./texlive" --strip-components 1 -f- | |
sudo ./texlive/install-tl | |
read -p "TEXLIVE VERSION: " VER | |
"/usr/local/texlive/$VER/bin/x86_64-linux/tlmgr" init-usertree # https://tex.stackexchange.com/questions/137428/tlmgr-cannot-setup-tlpdb | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
rm -rf ./texlive | |
;; | |
* ) | |
;; | |
esac | |
read -p "Oh-My-Zsh! (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
;; | |
* ) | |
;; | |
esac | |
read -p "EAGLE 6 (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
sudo apt-get install libxrender-dev libxrender-dev:i386 libxrandr-dev libxrandr-dev:i386 libxcursor-dev libxcursor-dev:i386 libfreetype6-dev libfreetype6-dev:i386 libfontconfig1-dev libfontconfig1-dev:i386 libxi-dev libxi-dev:i386 libssl1.0-dev libssl1.0-dev:i386 | |
mkdir "$HOME/Apps/Eagle6" | |
wget -O eagle6.run ftp://ftp.cadsoft.de/eagle/program/6.6/eagle-lin-6.6.0.run | |
sudo chmod +x eagle6.run | |
./eagle6.run "$HOME/Apps/Eagle6" | |
sudo chmod +x "$HOME/Apps/Eagle6/bin/eagle" | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
rm -rf ./eagle6.run | |
;; | |
* ) | |
;; | |
esac | |
############################################################################### | |
echo 'PLUGINS AND EXTRA FILES' | |
read -p "INPUT MONO FONT (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
mkdir "$HOME/.fonts" | |
wget -O "Input-Font.zip" "http://input.fontbureau.com/build/?fontSelection=fourStyleFamily®ular=InputMono-Regular&italic=InputMono-Italic&bold=InputMono-Bold&boldItalic=InputMono-BoldItalic&a=ss&g=ss&i=topserif&l=topserif&zero=slash&asterisk=0&braces=straight&preset=default&line-height=1.2&accept=I+do&email=" | |
unzip -j Input-Font.zip "Input_Fonts/Input/*.ttf" -d "$HOME/.fonts" | |
fc-cache -fv | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
rm -f 'Input-Font.zip' | |
;; | |
* ) | |
;; | |
esac | |
read -p "ATOM ADD-ONS [OPEN AND CLOSE ATOM BEFORE PRESSING Y] (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
apm disable markdown-preview | |
# PACKAGES | |
apm install atom-alignment atom-beautify auto-update-plus color-picker docblockr file-icons highlight-line highlight-selected hydrogen language-latex markdown-preview-enhanced minimap multi-cursor multi-paste pdf-view pigments platformio-ide platformio-ide-terminal remember-folds sublime-style-column-selection tablr tabs-to-spaces | |
# autocomplete-paths fonts git-plus highlight-column linter minimap-highlight-selected sync-settings terminal-plus | |
# THEMES | |
apm install atom-material-syntax atom-material-syntax-dark atom-material-syntax-light atom-material-ui monokai | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
;; | |
* ) | |
;; | |
esac | |
############################################################################### | |
read -p "GNOME EXTENSIONS (y/n): " answer | |
case ${answer:0:1} in | |
y|Y ) | |
echo 'MULTI MONITORS' | |
mkdir "$HOME/.local/share/gnome-shell/extensions" | |
git clone 'git://github.com/spin83/multi-monitors-add-on.git' | |
cp -r multi-monitors-add-on/multi-monitors-add-on@spin83 "$HOME/.local/share/gnome-shell/extensions" | |
rm -rf multi-monitors-add-on | |
read -p 'INSTALL/ENABLE GNOME SHELL INTEGRATION EXTENSION ON FIREFOX AND PRESS ANY BUTTON' | |
sleep 1 | |
# Dash to Panel, Impatience, User Themes, Workspace Grid | |
firefox https://extensions.gnome.org/extension/1160/dash-to-panel/ https://extensions.gnome.org/extension/277/impatience/ https://extensions.gnome.org/extension/19/user-themes/ https://extensions.gnome.org/extension/484/workspace-grid/ | |
# CURRENTLY NOT WORKING | |
# echo 'WORKSPACE SWITCHER THUMBNAILS' | |
# cd ~/Downloads | |
# git clone 'git://github.com/sustmi/gnome-shell-extension-workspace-switcher-popup-thumbnails.git' gnome-shell-extension-workspace-switcher-popup-thumbnails@sustmidown.centrum.cz | |
# cp -r gnome-shell-extension-workspace-switcher-popup-thumbnails@sustmidown.centrum.cz ~/.local/share/gnome-shell/extensions | |
# rm -rf ~/Downloads/gnome-shell-extension-workspace-switcher-popup-thumbnails@sustmidown.centrum.cz | |
gsettings set org.gnome.shell.app-switcher current-workspace-only true # https://askubuntu.com/questions/464946/ubuntu-gnome-force-alt-tab-to-switch-only-on-current-workspace | |
echo 'PRESS ANY KEY TO CONTINUE (CTRL+C TO EXIT)'; read -n 1 -s | |
;; | |
* ) | |
;; | |
esac | |
############################################################################### | |
# GENERAL CONFIGURATIONS | |
# Add location bookmarks to Nautilus (Ctrl+D) | |
# Customize sidebar icons | |
############################################################################### | |
# PROGRAM CONFIGURATIONS | |
# GRUB-CUSTOMIZER | |
# Customize settings (entries, default entry, entry seconds) | |
# TERMINATOR | |
# Customize settings | |
# MOZILLA FIREFOX | |
# Change appearance | |
# Customize settings | |
# Sync login | |
# LastPass login | |
# Sites login | |
# GNOME TWEAKS | |
# Customize settings | |
# Change icon theme (Paper) | |
# SUBLIME TEXT | |
# Set as default (subl /usr/share/applications/defaults.list - REPLACE gedit WITH sublime_text, SOURCE: https://askubuntu.com/questions/396938/how-do-i-make-sublime-text-3-the-default-text-editor) | |
# Install Package Control (View > Show Console > import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)) | |
# Install BufferScroll (git clone https://github.com/titoBouzout/BufferScroll.git $HOME/.config/sublime-text-3/Packages/BufferScroll) | |
# Install other packages: hextoASCII, HTML-CSS-JS Prettify, Indent XML, INI, TerminalView, Text Pastry, Theme - Cyanide, C Improved | |
# Copy User Settings and Keybindings (external files) | |
# SPOTIFY | |
# Customize settings | |
# Login | |
# Oh-My-Zsh! | |
# Copy .zshrc (external file) | |
# ATOM | |
# Customize settings | |
# Change theme (Material, Ubuntu Orange: #E95420) | |
# Change font (Input) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment