Skip to content

Instantly share code, notes, and snippets.

@erfanoabdi
erfanoabdi / sparse_convertor.sh
Created August 6, 2017 04:34
sparseChunks to image Convertor for motorola images
#!/bin/sh
#SparseChunks to image Convertor for motorola images by Erfan Abdi
#special thanks to superR for header removal script
#make sure you have only one image with sparse chunks (system or oem)
echo "Converting all SparseChunks to Raw Image"
./simg2img *chunk* system.img.raw
echo "Removing Moto Header"
offset=$(LANG=C grep -aobP -m1 '\x53\xEF' system.img.raw | head -1 | gawk '{print $1 - 1080}')
dd if=system.img.raw of=system_moto.img ibs=$offset skip=1 2>&1
@rgiaviti
rgiaviti / UnidadeFederacao.java
Last active March 28, 2024 23:43
Enum Java com todas as Unidades da Federação do Brasil
/**
* Enum com todas as Unidades da Federação do Brasil. Contém o nome da Unidade, a sigla e a capital
* da Unidade da Federação. As unidades estão listadas por ordem alfabética no enum.
*
* @author Ricardo Giaviti
* @version 1.1.1
* @since 1.0.0
*/
public enum UnidadeFederacao {
@ceving
ceving / Web Component for Copyright Years.md
Last active March 28, 2024 23:41
Web Component for Copyright Years
@2ndshadow
2ndshadow / Delegate.md
Last active March 28, 2024 23:40
How to delegate to a worker node

How to delegate to a worker node

  1. Go to 'Workers' page

  2. Select a Worker node with high APR image

  3. Click 'Delegate', select amount to delegate and confirm. image image

  4. Sign the transaction

@James-Ansley
James-Ansley / pi5_fan_controller.py
Last active March 28, 2024 23:37
Raspberry Pi 5 Auto Fan Controller
from enum import Enum
import time
TEMP_PATH = "/sys/devices/virtual/thermal/thermal_zone0/temp"
FAN_PATH = "/sys/class/thermal/cooling_device0/cur_state"
class FanSpeed(Enum):
OFF = 0
LOW = 1
@bruvv
bruvv / pwnagotchi change wlan card.md
Last active March 28, 2024 23:34
pwnagotchi change wlan card

I want to disable monitor mode for the interal wlan0 card of the pi. If you want to do that too and use wlan1 as mon0 do:

sed -i 's/phy0/phy1/g' /usr/bin/pwnlib

If you want wlan0 and wlan1 in monitor mode and want to use wlan1 as pwnagotchi device, use this ps did didn't work for me but above example

sudo su
rm /etc/network/interfaces.d/wlan1-cfg
@CMCDragonkai
CMCDragonkai / regular_expression_engine_comparison.md
Last active March 28, 2024 23:34
Regular Expression Engine Comparison Chart

Regular Expression Engine Comparison Chart

Many different applications claim to support regular expressions. But what does that even mean?

Well there are lots of different regular expression engines, and they all have different feature sets and different time-space efficiencies.

The information here is just copied from: http://regular-expressions.mobi/refflavors.html

@alexishida
alexishida / nginx-config-auth-cert-ssl.md
Last active March 28, 2024 23:34
Tutorial to configure Nginx client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Original: https://gist.github.com/mtigas/952344

Convert SSL certificate from CRT format to PEM

openssl x509 -in server.crt -out server.der -outform DER
openssl x509 -in server.der -inform DER -out server.pem -outform PEM
@OrionReed
OrionReed / DOM3D.js
Last active March 28, 2024 23:32
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@dmitriyvolk
dmitriyvolk / animals.Animal.java
Created March 26, 2024 23:16
Generics: RedRover 2024 Spring Lecture 16
package animals;
public class Animal {
private final String name;
private final double weight;
private final double canLiftWeight;
public Animal(String name, double weight, double canLiftWeight) {
this.name = name;
this.weight = weight;