Skip to content

Instantly share code, notes, and snippets.

View ael-g's full-sized avatar

Ael Gain ael-g

View GitHub Profile
{
"schemaVersion": 1,
"label": "Hello",
"message": "World",
"color": "orange"
}
@ael-g
ael-g / gist:de95c0f3e2202a5574840cfebacfcc47
Last active January 27, 2021 08:58
Google sql query helpers
gcloud logging read --limit 100 --order desc '-textPayload=~"automatic vacuum of table" AND timestamp<="2021-01-25T18:00:00Z" AND timestamp<="2021-01-25T23:00:00Z" AND resource.labels.database_id="XXX"' --format json | jq '.[].textPayload' | tail -r
<!DOCTYPE html><html lang="fr"><head><script>
window.gdprAppliesGlobally=true;(function(){function a(e){if(!window.frames[e]){if(document.body&&document.body.firstChild){var t=document.body;var n=document.createElement("iframe");n.style.display="none";n.name=e;n.title=e;t.insertBefore(n,t.firstChild)}
else{setTimeout(function(){a(e)},5)}}}function e(n,r,o,c,s){function e(e,t,n,a){if(typeof n!=="function"){return}if(!window[r]){window[r]=[]}var i=false;if(s){i=s(e,t,n)}if(!i){window[r].push({command:e,parameter:t,callback:n,version:a})}}e.stub=true;function t(a){if(!window[n]||window[n].stub!==true){return}if(!a.data){return}
var i=typeof a.data==="string";var e;try{e=i?JSON.parse(a.data):a.data}catch(t){return}if(e[o]){var r=e[o];window[n](r.command,r.parameter,function(e,t){var n={};n[c]={returnValue:e,success:t,callId:r.callId};a.source.postMessage(i?JSON.stringify(n):n,"*")},r.version)}}
if(typeof window[n]!=="function"){window[n]=e;if(window.addEventListener){window.addEventListener("mess
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: test-linkerd
name: test-linkerd
spec:
replicas: 10
revisionHistoryLimit: 10
selector:
@ael-g
ael-g / lbc
Created November 21, 2020 17:42
<!DOCTYPE html><html lang="fr"><head><script>window.gdprAppliesGlobally=true;(function(){function a(e){if(!window.frames[e]){if(document.body&&document.body.firstChild){var t=document.body;var n=document.createElement("iframe");n.style.display="none";n.name=e;n.title=e;t.insertBefore(n,t.firstChild)}
else{setTimeout(function(){a(e)},5)}}}function e(n,r,o,c,s){function e(e,t,n,a){if(typeof n!=="function"){return}if(!window[r]){window[r]=[]}var i=false;if(s){i=s(e,t,n)}if(!i){window[r].push({command:e,parameter:t,callback:n,version:a})}}e.stub=true;function t(a){if(!window[n]||window[n].stub!==true){return}if(!a.data){return}
var i=typeof a.data==="string";var e;try{e=i?JSON.parse(a.data):a.data}catch(t){return}if(e[o]){var r=e[o];window[n](r.command,r.parameter,function(e,t){var n={};n[c]={returnValue:e,success:t,callId:r.callId};a.source.postMessage(i?JSON.stringify(n):n,"*")},r.version)}}
if(typeof window[n]!=="function"){window[n]=e;if(window.addEventListener){window.addEventListener("message",t,fals
#!/bin/sh
set -vx
g++ -fPIC -std=c++11 -fwrapv -O4 -DNDEBUG -I. -Iortools/gen -I/root/or-tools-7.1/dependencies/install/include -I/root/or-tools-7.1/dependencies/install/include -I/root/or-tools-7.1/dependencies/install/include -I/root/or-tools-7.1/dependencies/install/include -I/root/or-tools-7.1/dependencies/install/include/coin -I/root/or-tools-7.1/dependencies/install/include -I/root/or-tools-7.1/dependencies/install/include/coin -I/root/or-tools-7.1/dependencies/install/include -I/root/or-tools-7.1/dependencies/install/include/coin -DUSE_CLP -I/root/or-tools-7.1/dependencies/install/include -I/root/or-tools-7.1/dependencies/install/include/coin -I/root/or-tools-7.1/dependencies/install/include -I/root/or-tools-7.1/dependencies/install/include/coin -DUSE_CBC -Wno-deprecated -DUSE_GLOP -DUSE_BOP -I/usr/include/python3.5m -I/usr/lib/python3.5 -DPY3 \
-c ortools/gen/ortools/constraint_solver/constraint_solver_python_wrap.cc \
-o objs/swig/constraint_solver_python_wrap.o
g++ -shared
@ael-g
ael-g / read-access.sql
Created August 8, 2018 10:25 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@ael-g
ael-g / Get ingress rules
Last active June 19, 2018 15:46
Get ingress rules
for i in `seq 0 $(grep resource charts-habx.tf | wc -l)`; do json2hcl -reverse < charts-habx.tf | jq ".[][$i][][][][].values" 2>&1 | grep -v null | yq -j '.' | yq . | jq -r '. | "\(.name) \(.ingress.host)\(.ingress.route)"' | grep -v null ; done
@ael-g
ael-g / sendEmails.sh
Created June 11, 2018 09:16
Send emails in batch with mailgun
#!/bin/bash
for email in ./emails_all/*; do
sleep 0.7
swaks --auth --server smtp.mailgun.org --au postmaster@support.$YOUR_DOMAIN --ap '$YOUR_TOKEN' --to "support@$YOUR_DOMAIN" --from 'ael@$YOUR_DOMAIN' -d "$email" &
done;
@ael-g
ael-g / greece.json
Last active June 1, 2018 19:20
Greece
{
"title": {
"text": {
"headline": "Some Greek people",
"text": "That may be considered important"
}
},
"events": [
{
"media": {