Skip to content

Instantly share code, notes, and snippets.

View ticapix's full-sized avatar

Pierre Gronlier ticapix

View GitHub Profile
# installing NodeJS on Raspberry Pi (armv6l)
curl -sL https://nodejs.org/dist/v6.7.0/node-v6.7.0-linux-armv6l.tar.xz | tar --directory /\
usr/local/ --strip-components=1 -xvJf -
@ticapix
ticapix / cowroot.c
Created October 21, 2016 15:47 — forked from rverton/cowroot.c
CVE-2016-5195 (DirtyCow) Local Root PoC
/*
* (un)comment correct payload first (x86 or x64)!
*
* $ gcc cowroot.c -o cowroot -pthread
* $ ./cowroot
* DirtyCow root privilege escalation
* Backing up /usr/bin/passwd.. to /tmp/bak
* Size of binary: 57048
* Racing, this may take a while..
* /usr/bin/passwd overwritten
@ticapix
ticapix / Makefile
Last active February 14, 2020 09:08
Stub for python Makefile
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
PYTHON3=python3
VENV_DIR=$(ROOT_DIR)/venv3
NAME=$(shell basename $(ROOT_DIR))
ECHO=@echo
RM=rm -rf
.PHONY: help
help:
@ticapix
ticapix / export pdf.xlsm
Last active March 10, 2019 11:04
VBA code to export Excel spreadsheet to pdf file in local folder
## check if file already exists
Function FileExists(ByVal FileToTest As String) As Boolean
FileExists = (Dir(FileToTest) <> "")
End Function
## delete file if already generated
Sub DeleteFile(ByVal FileToDelete As String)
If FileExists(FileToDelete) Then 'See above
' First remove readonly attribute, if set
SetAttr FileToDelete, vbNormal
@ticapix
ticapix / Num2Word.xlsm
Created March 10, 2019 11:07
VBA module to convert a number to words, in Estonian.
## Usage: in a call, enter the formula `=SpellNumber(value)`. The cell will display the number in Estonian
Option Explicit
'Main Function
Function SpellNumber(ByVal MyNumber)
Dim Dollars, Cents, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = "tuhat, "
@ticapix
ticapix / vm.sh
Last active September 26, 2019 12:27
start / stop / getip from a VM on OVH Public Cloud. (default vm flavor is t1-45)
#!/bin/sh
set -e
. ./openrc.sh # download this config file from the api or the manager
for var in OS_AUTH_URL OS_IDENTITY_API_VERSION OS_TENANT_ID OS_USERNAME OS_PASSWORD OS_REGION_NAME; do
[ -z $( eval "echo \$$var" ) ] && (echo "Variable $var is undefined."; exit 1)
done
@ticapix
ticapix / activate.sh
Last active October 29, 2019 16:46
K8s activate and deasctivate scripts
#!/bin/sh
ls `pwd`/kubeconfig.yml && export KUBECONFIG=`pwd`/kubeconfig.yml
export PATH=`pwd`:$PATH
export HELM_HOME=`pwd`/.helm
which curl > /dev/null 2>&1 || { echo "try apt-get install curl first"; return 1; }
which jq > /dev/null 2>&1 || { echo "try apt-get install jq first"; return 1; }
# KUBECTL
#!/bin/sh
set -e
TERM=ansi
if [ $# -ne 1 ]; then
echo "usage: $0 <ngpus:int>"
echo "This script has to be executed on the t1-(45|90|180) VM directly"
exit 1
fi

HELM 3

install Helm

sudo snap install helm --classic

add repo

did:3:bafyreic4cizpwwnklbzzrxgmmfbde3mzt23vs4ultnon5keiutgz55hute