Skip to content

Instantly share code, notes, and snippets.

View jarkko-hautakorpi's full-sized avatar

Jarkko jarkko-hautakorpi

View GitHub Profile
<?
# Add following line in ".htaccess".
# php_value auto_prepend_file compat.php
$HTTP_SERVER_VARS = $_SERVER;
$HTTP_COOKIE_VARS = $_COOKIE;
$HTTP_POST_VARS = $_POST;
$HTTP_GET_VARS = $_GET;
<a href="javascript:(function(){doms = document.getElementsByTagName('*');for (var i=0, max=doms.length; i < max; i++) {if(typeof doms[i].setAttribute === 'function') {doms[i].setAttribute('contenteditable','true');}}})();" title="Drag this to bookmarks toolbar">Edit This Page</a>
@jarkko-hautakorpi
jarkko-hautakorpi / build.sh
Last active July 13, 2018 18:42 — forked from aczid/build.sh
AVR build script for bleeding edge toolchain
# - requires git, svn, hg installed
# - will just build the bleeding edge of everything
export PREFIX=`pwd`
export PATH=$PATH:$PREFIX/bin/
export SRCDIR=$PREFIX/src/
# todo test if SRCDIR exists, then get the source
mkdir -p $SRCDIR
# get binutils/gdb, gmp, mpfr, mpc

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
#!/usr/bin/env ruby
require 'open-uri'
require 'pathname'
require 'json'
def strip_hash(f)
ext = f.extname
if ext.include?("?")
@jarkko-hautakorpi
jarkko-hautakorpi / mysql_backup.sh
Created September 2, 2020 06:26 — forked from tleish/mysql_backup.sh
Bash Script to backup all MySQL databases
#!/bin/bash
#==============================================================================
#TITLE: mysql_backup.sh
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#VERSION: 0.4
#USAGE: ./mysql_backup.sh
#CRON:
# example cron for daily db backup @ 9:15 am
@jarkko-hautakorpi
jarkko-hautakorpi / worpress-notes.md
Last active September 12, 2020 13:32
Notes about working with worpress..

Allow file access in localhost for updating etc..

wp-config.php

  define('WP_HOME', 'https://blog.local.host');
  define('WP_SITEURL', 'https://blog.local.host');
  define('FS_METHOD', 'direct');
@jarkko-hautakorpi
jarkko-hautakorpi / gist:681a5957d991fb91033048177b3d1936
Last active September 5, 2021 21:09
build-mosquitto-with-websockets.md
#Ubuntu 18.04, with websockets and systemd notify
git clone https://github.com/eclipse/mosquitto.git mosquitto-git
cd mosquitto-git
git checkout v1.6.15
sudo apt install -Y cmake libssl-dev uuid-dev xsltproc docbook-xsl libsystemd-dev libwebsockets-dev libcunit1-dev
make && make test
sudo make install
@jarkko-hautakorpi
jarkko-hautakorpi / download_all_apk_files.php
Last active July 20, 2022 10:08
Download all APK files from android device
#!/usr/bin/php
<?php
$list = "adb shell pm list packages";
$path = "adb shell pm path %s"; // adb shell pm path com.example.someapp
$get = "adb pull %s %s"; // adb pull /data/app/com.example.someapp-2.apk path/to/desired/destination
$apkdir = getcwd() . "/apk";
if (!is_dir($apkdir)) {
if (mkdir($apkdir)) {
echo "Created directory $apkdir\n";
git clone https://github.com/cpacker/MemGPT.git
conda create -n memgpt python=3.10
conda activate memgpt
cd memgpt
pip install -r requirements.txt
export OPENAI_API_KEY="YOUR_API_KEY"
# download .txt docs from: https://huggingface.co/datasets/MemGPT/example-sec-filings/tree/main
wget https://huggingface.co/datasets/MemGPT/example-sec-filings/blob/main/airbnb.txt -P memgpt/personas/examples/preload_archival
wget https://huggingface.co/datasets/MemGPT/example-sec-filings/blob/main/lyft.txt -P memgpt/personas/examples/preload_archival
wget https://huggingface.co/datasets/MemGPT/example-sec-filings/blob/main/uber.txt -P memgpt/personas/examples/preload_archival