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
# Remember to first import the config into openvpn3. Change the $CONFIG_NAME into name that makes sense to you | |
# openvpn3 config-import --config profile.ovpn --name $CONFIG_NAME | |
# Add the code below to your shell's .rc file. Replace the strings below with the proper values. | |
# - $CONFIG_NAME | |
# - EMAIL_ADDRESS | |
# - BASE64_ENCODED_PASSWORD - To avoid exposing your password | |
vpn-off () { | |
openvpn3 session-manage --config $CONFIG_NAME --disconnect 2> /dev/null |
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
RETVAL_b="#005f87" # background | |
RETVAL_f="#eceeed" # foreground | |
HOST_b="#5f87af" | |
HOST_f="#eceeed" | |
USER_b="#005f87" | |
USER_f="#eceeed" | |
GIT_b="#f6b3b3" | |
GIT_f="#d95353" | |
GIT_CLEAN_b="#b3f58c" | |
GIT_CLEAN_f="#568459" |
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
# Get openssl-1.1.1 tar gz | |
wget https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1t/openssl-1.1.1t.tar.gz | |
./config shared enable-ec_nistp_64_gcc_128 -Wl,-rpath=/usr/local/openssl/lib --prefix=/usr/local/openssl | |
make -j 4 | |
make test && sudo make install | |
# Then finally install PHP 7 | |
cd /usr/local/openssl | |
export PHP_OPENSSL_DIR=yes |
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
PROMPT='%{$FG[255]%}%{$BG[068]%} %n@%m %{$reset_color%}%{$FG[255]%}%{$BG[025]%} %/ %{$reset_color%}$(git_prompt_info) | |
%(!.#.$) ' | |
RPROMPT='%{$FG[255]%}%{$BG[068]%} %D{%H:%M:%S} %{$reset_color%}' | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$FG[255]%}%{$BG[071]%} " | |
ZSH_THEME_GIT_PROMPT_SUFFIX=" %{$reset_color%}" |
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
<?php | |
include __DIR__ . "/vendor/autoload.php"; | |
use Elastica\Client; | |
use Monolog\Formatter\LogstashFormatter; | |
use Monolog\Handler\ElasticSearchHandler; | |
use Monolog\Logger; | |
$logger = new Logger("MyApp"); |
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
<?php | |
$validInput = "[email protected]"; | |
$invalidInput = "\"'/><script>alert(1)</script>"; | |
echo "Valid: "; | |
echo filter_var($validInput, FILTER_VALIDATE_EMAIL); | |
echo PHP_EOL; | |
echo "Invalid: "; |
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 | |
FILE="$1" | |
TMP_FILE="$FILE.tmp" | |
if [ -f "$FILE" ]; then | |
IS_ISO=$(file -I "$FILE" | grep 8859) | |
if [ -n "$IS_ISO" ]; then | |
iconv -f iso-8859-1 -t utf-8 "$FILE" > "$TMP_FILE" |
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
PROMPT=$' | |
%{$fg[white]%}%n@%m%{$reset_color%} %{$fg[blue]%}[%/]%{$reset_color%} $(git_prompt_info)$(bzr_prompt_info) | |
%{$fg_bold[black]%}\$%{$reset_color%} ' | |
PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}" | |
GIT_CB="git::" | |
ZSH_THEME_SCM_PROMPT_PREFIX="%{$fg[green]%}[" | |
ZSH_THEME_GIT_PROMPT_PREFIX=$ZSH_THEME_SCM_PROMPT_PREFIX$GIT_CB | |
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} " |
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 | |
title="$1" | |
message="$2" | |
param='display notification "'$2'" with title "'$1'"' | |
osascript -e "$param" | |
# Usage: alertme "Title" "Message" |
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 python2 | |
# | |
# This script will run something every 2 seconds and print a line in between | |
# | |
# Usage: intrun command | |
from subprocess import call | |
from sys import argv, exit | |
from time import sleep |
NewerOlder