Skip to content

Instantly share code, notes, and snippets.

View jarkko-hautakorpi's full-sized avatar

Jarkko jarkko-hautakorpi

View GitHub Profile
@sahib
sahib / semaphor.c
Last active September 4, 2019 10:22
A rather primitive Semaphore implementation in C using pthreads
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
/* Stupid implementation of C semaphores with pthreads.
* Used as mutex for counting a variable below.
*
* compile with:
*
* cc semaphor.c -o sam -lpthread -Wall -Wextra -std=c99 -Os
@milo
milo / github-webhook-handler.php
Last active July 26, 2023 15:29
GitHub Webhook Handler
<?php
/**
* GitHub webhook handler template.
*
* @see https://docs.github.com/webhooks/
* @author Miloslav Hůla (https://github.com/milo)
*/
$hookSecret = 's.e.c.r.e.t'; # set NULL to disable check
@tleish
tleish / mysql_backup.sh
Last active May 28, 2024 04:55
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?("?")
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active July 15, 2024 09:31
Self Signed Certificate with Custom Root CA

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
@Evilcry
Evilcry / scada_password_recovery_list.csv
Last active March 21, 2024 14:59
SCADA Password Recovery List
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 1 column, instead of 8. in line 7.
Yokogawa;CENTUM CS 3000 DCS;CENTUM:CENTUM
Yokogawa;EJX910A Multivariable Transmitter HART Communication Type;YOKOGAWA. (to release the Write Protect mode)
Yokogawa;WT 3000 Driver;anonymous:blank (Ethernet access)
Yokogawa;DX1000/DX1000N/DX2000 Advanced;Administrator 1:Admin1 etc./ User 1:User01 etc.
Yokogawa;YFGW410 gateway;admin:!admin
Wonderware;System Platform/Archestra;administrator:blank
Wonderware;Intouch;Administrator:Wonderware
Wonderware;Historian;SQL Server Login: aadbo:pwddbo, wwdbo:pwddbo, aaAdmin:pwAdmin, wwAdmin:wwAdmin, aaPower:pwPower, wwPower:wwPower, aaUser:pwUser, wwUser:wwUser
Westermo;TDW 33;no password, just return, Hardcoded password: n3Y9kA6otYZu8, (?? TD-36)
Westermo;MRD-305-DIN/MRD-310/MRD-315/MRD-330/MRD-355/MRD-350/MRD-455;admin:westermo
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@DKrepsky
DKrepsky / Kicad project relative path
Created July 13, 2017 14:12
Add project relative path into kicad
To add paths relative to the project folder use the environment variable ${KIPRJMOD}.
Example: ${KIPRJMOD}/3d/resistor_model.wrl
@micw
micw / w132.ino
Last active January 4, 2022 16:58
Ventus W132 decoder sketch
/**
* Ein ESP8622 NodeMCU Develompent Board, welches Sensorwerte via MQTT verschickt
* http://frightanic.com/iot/comparison-of-esp8266-nodemcu-development-boards/
*
* Umbau eines W132 Windsensors von ELV
*
* - Abtrennen des 433 MHZ-Senders, welcher mit 3 Leitungen (Schwarz, Rot, Blau) an der Logik-Platine angeschlossen ist
* - Anschließen des ESP-8266
* - Schwarz -> GND
* - Rot -> 3.3V
@Staars
Staars / mj_ht_v1.ino
Created February 1, 2020 08:49
Xiaomi test (from cbm80amiga) with the OLED-part removed
// Reading Xiaomi Mi BLE Temperature & Humidity Monitor
// Code for the video: https://youtu.be/pyhpXnFzNhU
// (C)2019 Pawel A. Hernik
// BLE code based on Dmitry Grinberg and Florian Echtler work
/* PINOUT
nRF24L01 from pin side/top:
-------------
|1 3 5 7 |
|2 4 6 8 |