Skip to content

Instantly share code, notes, and snippets.

@pthavarasa
pthavarasa / mysqldump.php
Created August 19, 2022 17:59
Easy way to dump ( backup ) MySQL database with PHP script
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$user = 'wordpress';
$pass = 'password';
$host = 'localhost';
@dr-vortex
dr-vortex / aliases.sh
Last active May 4, 2024 15:18
Useful `git` aliases
#!/bin/bash
# Adds some useful git aliases
echo "Adding aliases"
# Lists all of the changes (i.e. commit messages) from the last tag to HEAD
# "- " prefixed before each line for easily making a markdown list
git config --global alias.ls-changes '!git log --format=%B $(git describe --tags --abbrev=0)..HEAD | grep -v -e "^$" | sed -e "s/^/- /"'
@xunker
xunker / pocsag_fortune.sh
Last active May 4, 2024 15:18
Send text to POCSAG pager using rpitx
# Send a page to a POCSAG pager using rpitx (https://github.com/F5OEO/rpitx).
# Place this script in the root directory of the rpitx repo when you check it out.
#
# Requires the `fortune` program to be installed: `sudo apt-get install fortune`
#
# In default config, set to transmit to an Apollo AL-A25 pager.
CAPCODE="0268778A"
FREQUENCY=157740000
BAUD=512
FORTUNE=$(fortune | tr '\n' ' '); echo $FORTUNE; printf "$CAPCODE:$FORTUNE" | sudo ./pocsag -f $FREQUENCY -r $BAUD
@m-Phoenix852
m-Phoenix852 / discord-token-logger.js
Created August 26, 2020 07:45
Simple script to log in to discord account using token.
let token = "your token";
function login(token) {
setInterval(() => {
document.body.appendChild(document.createElement `iframe`).contentWindow.localStorage.token = `"${token}"`
}, 50);
setTimeout(() => {
location.reload();
}, 2500);
}
@kyo-takano
kyo-takano / making-the-most-of-local-llms.ipynb
Last active May 4, 2024 15:12
ローカルLLMはこーやって使うの💢
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import sys
import struct
import binascii
from collections import Counter
def u16(b):
return struct.unpack('<H', b)[0]
def p16(x):
return struct.pack('<H', x)
def p32(x):
@leocomelli
leocomelli / git.md
Last active May 4, 2024 15:12
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

#!/bin/bash
clear
echo "$COL_GREEN Radius Manager installer script for CENTOS 6.x 32bit"
echo "Copyright 2004-2013, DMA Softlab LLC"
echo "All right reserved.. $COL_RESET"
echo "$COL_GREEN Script modified by Syed Jahanzaib for CENTOS"
# Colors Config . . . [[ JZ . . . ]]
ESC_SEQ="\x1b["
COL_RESET=$ESC_SEQ"39;49;00m"
@konstantin24121
konstantin24121 / verifyTelegramWebAppData.tsx
Last active May 4, 2024 15:09
Telegram Bot 6.0 Validating data received via the Web App node implementation
const TELEGRAM_BOT_TOKEN = '110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw'; // https://core.telegram.org/bots#creating-a-new-bot
export const verifyTelegramWebAppData = async (telegramInitData: string): boolean => {
// The data is a query string, which is composed of a series of field-value pairs.
const encoded = decodeURIComponent(telegramInitData);
// HMAC-SHA-256 signature of the bot's token with the constant string WebAppData used as a key.
const secret = crypto
@mvaisakh
mvaisakh / Bringup.md
Last active May 4, 2024 15:08
An Android Device Tree Bringup Guide

A small Device Tree Bringup Guide

Introduction

So, you guys might be wondering, how do these "Developers" get your favourite Custom roms, such as LineageOS, Paranoid Android etc., to their own devices. Well I'm here to Guide you on how to do it, specifically on how to bringup or make your own device tree from scratch or adapting.

Gist of this Guide: This is for people with genuine interest in Android OS porting/development. After going through this guide, you should be able to do a total device tree bringup on your own.

Prerequisite: Certain requirements are to be met before you start with this amazing journey.