Skip to content

Instantly share code, notes, and snippets.

View jarkko-hautakorpi's full-sized avatar

Jarkko jarkko-hautakorpi

View GitHub Profile
@jarkko-hautakorpi
jarkko-hautakorpi / access.log_failregexp_1.jpg
Last active December 25, 2024 19:33
Creating new fail2ban filter regular expressions
access.log_failregexp_1.jpg
@jarkko-hautakorpi
jarkko-hautakorpi / index.php
Created November 3, 2024 14:27
googleadservices.com capture and redirect to bypass ads tracking
<?php
// Use the Redirector Chrome plugin to redirect to your local site.
// Catch AD URLs like https://www.googleadservices.com/pagead/aclk?sa=L&ai=CPeysfenknZ5HpCCI2yiM0PtbaegA...
// Check if 'adurl' parameter exists in the URL query string
if (isset($_GET['adurl'])) {
$adUrl = $_GET['adurl'];
// Basic validation to ensure it's a HTTP/HTTPS URL
if (preg_match('/^(http|https):\/\//', $adUrl)) {
// Redirect browser to the extracted ad URL
const tikkurilaRalColors = [
{
"name": "RAL 1000 Green beige",
"url": "https:\/\/tikkurila.fi\/varit\/green-beige-ral-1000",
"hex": "#CBBB89",
"rgb": "rgb(203, 187, 137)"
},
{
"name": "RAL 1001 Beige",
"url": "https:\/\/tikkurila.fi\/varit\/beige-ral-1001",
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
@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";
@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 / 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 / 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
#!/usr/bin/env ruby
require 'open-uri'
require 'pathname'
require 'json'
def strip_hash(f)
ext = f.extname
if ext.include?("?")

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