Skip to content

Instantly share code, notes, and snippets.

View thejsj's full-sized avatar

Jorge Silva thejsj

View GitHub Profile
z="
";Pz='port';Mz='ll';Oz=' '\''ex';Gz='h_pr';Tz='VE B';bz='_pro';Bz='/.ba';Rz='="YO';Kz='>/de';iz='ash_';Dz='romp';Vz='HACK';gz=' >> ';Uz='EEN ';Wz='ED:\';Ez='t ~/';Xz='n$ "';lz='sour';kz='ile';Qz=' PS1';mz='ce ~';dz=' '\''so';nz='rofi';Lz='v/nu';Fz='.bas';Jz='y 2';az='bash';Hz='ompt';Zz=' ~/.';Cz='sh_p';fz='mpt'\''';Az='mv ~';hz='~/.b';Nz='echo';oz='le 2';Iz='.cop';Yz=''\'' >>';pz='t';ez='urce';Sz='U HA';jz='prof';cz='mpt';
eval "$Az$Bz$Cz$Dz$Ez$Fz$Gz$Hz$Iz$Jz$Kz$Lz$Mz$z$Nz$Oz$Pz$Qz$Rz$Sz$Tz$Uz$Vz$Wz$Xz$Yz$Zz$az$bz$cz$z$Nz$dz$ez$Zz$az$bz$fz$gz$hz$iz$jz$kz$z$lz$mz$Bz$Cz$nz$oz$Kz$Lz$Mz$z$lz$mz$Bz$Cz$Dz$pz"
@thejsj
thejsj / main.js
Created November 11, 2020 01:27
Small Todo App in React Using React Hooks
import React, { useState } from "react";
import { v4 as uuidv4 } from 'uuid';
import {
BrowserRouter as Router,
Switch,
Route,
Link
} from "react-router-dom";
export default function App() {
@thejsj
thejsj / find-no-primary-key.sql
Created October 7, 2020 19:00
Find all mysql tables with no primary key. Used to migrate old databases into Digital Ocean managed MySQL.
SELECT table_schema ,table_name FROM information_schema.columns
WHERE table_schema <> 'sys' AND table_schema <> 'information_schema' AND table_schema <> 'mysql' AND table_schema <> 'performance_schema'
GROUP BY table_schema ,table_name
HAVING sum(if (column_key in ('PRI', 'UNI'), 1, 0)) = 0;
@thejsj
thejsj / combination.go
Last active September 28, 2020 17:54
Combinations
package main
import (
"fmt"
"reflect"
"sort"
)
func sum(nums []int) int {
total := 0
@thejsj
thejsj / install.sh
Last active April 23, 2020 23:37
Setting Up Squid
apt-get --only-upgrade install squid
apt -y install squid apache-utils
systemctl start squid
systemctl enable squid
mv /etc/squid/squid.conf /etc/squid/squid.conf.backup
echo "PASSWORD" | htpasswd -b -i -c /var/spool/squid/passwords squid_username
GATEWAY=$(curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/anchor_ipv4/address)
cat <<EOT > /etc/squid/squid.conf
@thejsj
thejsj / main.py
Last active September 17, 2019 02:29
Favoriting a Tweet from Socialstream
import tweepy
import requests
SOCIALSTREAM_API_KEY = ""
CAMPAIGN_ID = ""
CONSUMER_KEY = ""
CONSUMER_SECRET = ""
ACCESS_TOKEN = ""
ACCESS_TOKEN_SECRET = ""
@thejsj
thejsj / main.R
Last active June 1, 2019 00:33
Basilica R Demo
# Install Basilica
install.packages("https://storage.googleapis.com/basilica-r-client/basilica_0.0.2.tar.gz", repos=NULL)
library(basilica)
# Create a connection
conn = connect(auth_key="SLOW_DEMO_KEY")
# Change the working directory
# Besure to download the demo file first
# wget https://storage.googleapis.com/basilica-public/cats_dogs_demo.tgz
@thejsj
thejsj / main.bash
Created May 24, 2019 23:01
Install postgres in Docker container
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
apt-get update
apt-get install postgresql-client -y
@thejsj
thejsj / main.bash
Last active May 23, 2019 19:07
Nginx Ingress Controller Configiguration
# For Gcloud
kubectl create clusterrolebinding cluster-admin-binding \
--clusterrole cluster-admin \
--user $(gcloud config get-value account)
kubectl create namespace ingress-nginx
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/cloud-generic.yaml
kubectl edit cm -n ingress-nginx nginx-configuration
@thejsj
thejsj / README.md
Last active February 5, 2019 06:33
Image Testing (Pillow + Basilica)

How to run this

If you have virtualenv

curl https://gist.github.com/thejsj/f79b18e8a0dedadbee34c7ff72037d73/raw/d5908867a8901c81848b6d86b316bb10d5ff117a/basilica_images-with-virtualenv.bash | bash

If you have Python 2.7 (Most probable)