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
# PyInstaller/bindepend.py | |
#----------------------------------------------------------------------------- | |
# Copyright (c) 2013-2018, PyInstaller Development Team. | |
# | |
# Distributed under the terms of the GNU General Public License with exception | |
# for distributing bootloader. | |
# | |
# The full license is in the file COPYING.txt, distributed with this software. | |
#----------------------------------------------------------------------------- |
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
#!/usr/bin/env python3 | |
# https://github.com/keystroke3/redpaper/issues/1#event-2480042391 | |
def empty_string_checker(s): | |
if not s: # this is equivalent to saying `if s == "":` | |
print("String is empty!") | |
if s: # this is equivalent to saying `if s != "":` | |
print("String is not empty -- it contains '{}'".format(s)) | |
g = "" |
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
:filetype indent on | |
:set filetype=html | |
:set smartindent | |
gg=G |
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
##### WINDOWS ##### | |
$uri = 'https://sourceforge.net/projects/xming/files/Xming/6.9.0.31/Xming-6-9-0-31-setup.exe/download' | |
curl -L $uri > Xming-setup.exe |
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
#!/usr/bin/env bash | |
# https://github.com/estysdesu/dotFiles/blob/master/bash/.bash_profile | |
# one-liner | |
alias spotify_web="'`locate "*Google\ Chrome"`' --app="https://play.spotify.com"" # Spotify web client without all the junk | |
# functional | |
chrome_app=`locate "*Google\ Chrome"` | |
web_app () { | |
"$chrome_app" --app="$1" |
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
##### Ubuntu/Debian Apt ##### | |
# /etc/apt/apt.conf.d/proxy.conf | |
# https://www.serverlab.ca/tutorials/linux/administration-linux/how-to-set-the-proxy-for-apt-for-ubuntu-18-04/ | |
Acquire { | |
HTTP::proxy "<ip-addr>"; | |
HTTPS::proxy "<ip-addr>"; | |
} |
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
##### tar (ARCHIVING) ##### | |
# -z: gzip | |
# -j: bzip2 | |
# -J: xz | |
# if compression method is missing, tar tries to guess compression method (from extension) | |
# -c: create | |
# -x: extract | |
# -v: verbose (list each file) | |
# -f: archive file name | |
# -r: append to unzipped archive |
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
# change permissions on the key file (read) | |
chmod 400 <key.pem> | |
# ssh into the ec2 container | |
ssh -i "<key.pem>" uname@<ec2-address/ip-address> | |
# upgrade & update apt package manager (Debian/Ubuntu) | |
sudo apt update && apt upgrade | |
# check & update yum package manager (CentOS/RHEL) |
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
##### ln (SYMLINKS) ##### | |
# -n: no dereference (prevents recursion of directories by stopping link following) | |
# -f: force if already exists by unlinking first | |
# -s: symbolic | |
# -d/-F: directory | |
ln -sf <path/to/source/file> <path/to/dest/file> | |
ln -sFn <path/to/source/dir> <path/to/dest/dir> |
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
##### test OR [ -s/-n/-t/(etc...) ] (TEST CONDITIONALS) ##### | |
# https://www.gnu.org/software/bash/manual/html_node/Bash-Conditional-Expressions.html | |
# numeric and string are different for numbers -- `test 01 -eq 1` is true, but `test "01" == "1"` is obviously not | |
# -f: file exists | |
# -s: file exists and has size > 0 | |
# ! <-flag>: negate | |
# -d: directory exists | |
# -x: can execute | |
# <#> -eq <#>: numeric equality; good for exit codes | |
# <#> -ne <#>: numeric inequality (test if not equal) |