Skip to content

Instantly share code, notes, and snippets.

@1fexd
1fexd / id_austria_root_patch.md
Last active May 2, 2024 06:25
ID Austria / Digitales Amt mit Root und/oder entsperrtem Bootloader
@nickpeirson
nickpeirson / elasticsearch.json
Last active November 21, 2021 20:55
lnav format for ES 6.x, based on log4j2 pattern
{
"elasticsearch" : {
"title" : "Elasticsearch log4j2 pattern format",
"description" : "Log4j2 pattern format used bu Elasticsearch",
"regex" : {
"basic" : {
"pattern" : "^\\[(?<timestamp>\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2},\\d{3})\\]\\[(?<level>[^\\] ]+) *\\]\\[(?<component>[^\\]]+)\\] (?<body>(.*))\\n?(?<stacktrace>.*\\n(\\tat.*\\n?)*)?$"
}
},
"level-field" : "level",
@shuson
shuson / sample.js
Last active September 19, 2023 08:50
get base64 raw data of image from responseBody using jquery ajax
$.ajax({
type: "GET",
url: "imageURL",
beforeSend: function (xhr) {
xhr.overrideMimeType('text/plain; charset=x-user-defined');
},
success: function (result, textStatus, jqXHR) {
if(result.length < 1){
alert("The thumbnail doesn't exist");
$("#thumbnail").attr("src", "data:image/png;base64,");
@cspanring
cspanring / pip-install-gdal.md
Last active October 18, 2023 07:56
Installing GDAL in a Python virtual environment

Installing GDAL in a Python virtual environment

Get gdal development libraries:

$ sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
$ sudo apt-get update
$ sudo apt-get install libgdal-dev

Create and activate a virtual environment:

@stephenhardy
stephenhardy / git-clearHistory
Created April 26, 2013 22:14
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git