Skip to content

Instantly share code, notes, and snippets.

View cerealkill's full-sized avatar
:octocat:
To mars!

Paul Depraz cerealkill

:octocat:
To mars!
View GitHub Profile
@cerealkill
cerealkill / postregres_init_create_roles.sh
Created April 17, 2024 15:33
Create Postgres roles and users in init from .env files variables
#!/bin/bash
set -e
set -u
function create_user_and_database() {
if psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" -tXAc "SELECT 1 FROM pg_roles WHERE rolname='$POSTGRES_USER'"; then
echo Roles already exist, skipping creation.
else
echo Running SQL commands
# -*- coding: utf-8 -*-
import pickle
import tempfile
import subprocess
import re
from itertools import cycle
from pdfminer.pdfpage import PDFPage
@cerealkill
cerealkill / grep_regex.md
Created June 19, 2020 08:43
Command line examples for extracting ethreum addresses and private keys from repository

Ethereum

address

Depending on the programming language you might change the ending parameters to swap " for $ to get yaml config file or the sorts.

grep -rEi '0x[a-fA-F0-9]{40}(")?' .

raw private key

Keybase proof

I hereby claim:

  • I am cerealkill on github.
  • I am cerealkill (https://keybase.io/cerealkill) on keybase.
  • I have a public key ASAnPdzTQ2ebhWV1BqISjVHb1UivLAMeXw8e1rV4s6bTnwo

To claim this, I am signing this object:

@cerealkill
cerealkill / fileLookup.ts
Created July 25, 2017 15:17
Recursively checks for parent folders searching for file and return path if found.
/**
* Recursively checks for parent folders searching for file and return path if found.
* a/b/c
* a/b
* a
* @param {string} file File name. i.e. 'test.config.json'
* @param {string} dirName Path of directory to begin. i.e './a/b'
*/
export function fileLookup(file: string, dirName?: string): string {
// Defines the standard starting point as the path for this file.
@cerealkill
cerealkill / HassbianHardcoreConfig.md
Last active July 10, 2017 07:38
Configuration steps to Hassbian - Home Automation Server

First login user: pi and password: raspberry. Then you have to change the password. Note it will be required to input it twice.

pi@hassbian:~ $ sudo passwd pi

Our pi wasnt connected to the wifi network so we had to make it w/out a GUI:

pi@hassbian:~ $ sudo iwlist scan

Cell 01 - Address: 34:23:AF:5A:50:F7
@cerealkill
cerealkill / index.haml
Created May 14, 2017 23:07
Responsive Contact Form with Map
#browser
#browser-bar
.circles
.circles
.circles
%p Receive Slock.it notifications on every Rental!
%span.arrow.entypo-resize-full
#content
#left
#map
@cerealkill
cerealkill / cors.html
Last active August 29, 2015 14:22
CORS js GET/POST
<html>
<head>
<script type="text/javascript">
var isIE8 = window.XDomainRequest ? true : false;
var req = createCrossDomainRequest();
var url = 'http://kern.pythonanywhere.com/api';
function createCrossDomainRequest(url, handler) {
if (isIE8) {
request = new window.XDomainRequest();
@cerealkill
cerealkill / Portfolio.md
Last active July 10, 2017 09:12
Portfolio

Nextel TIP

Nextel 3G network antenna tracker aimed to support the network engineering team.

The project was a copy of another software solution and changed to suite tip project. I was in charge of the map and dashboards wich in both there was a huge changes in shown data almost daily. To respond to this demand everycode should be implemented with the maximum flexibility and abstraction.

Main repo: bitbucket

Most relevant sources:

** Dashboard 3 - 4 - Lots of dynamic content worked out by lots of reflection ** dashboard 3 bean