Skip to content

Instantly share code, notes, and snippets.

View deejay87's full-sized avatar
🙂

deejay87 deejay87

🙂
View GitHub Profile
@morales2k
morales2k / posts_from_page.php
Last active November 18, 2020 17:06
Get Facebook public posts from a page. This requires facebook's php sdk, and a properly registered app.
<?php
function make_links($text, $class='', $target='_blank'){
return preg_replace('!((http\:\/\/|ftp\:\/\/|https\:\/\/)|www\.)([-a-zA-Zа-яА-Я0-9\~\!\@\#\$\%\^\&\*\(\)_\-\=\+\\\/\?\.\:\;\'\,]*)?!ism', '<a class="'.$class.'" href="//$3" target="'.$target.'">$1$3</a>', $text);
}
define("APP_ID", 'xxxxxxxxxxxxxxxxxxx');
define("APP_SECRET",'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
define("PAGE_ID",'elnuevodia');
$config = array(
'appId' => APP_ID,
@massahud
massahud / Portable Node.js andNPM on windows.md
Last active April 24, 2024 06:38
Portable Node.js and NPM on windows
  1. Get node binary (node.exe) from http://nodejs.org/download/
  2. Create the folder where node will reside and move node.exe to it
  3. Download the last zip version of npm from http://nodejs.org/dist/npm
  4. Unpack the zip inside the node folder
  5. Download the last tgz version of npm from http://nodejs.org/dist/npm
  6. Open the tgz file and unpack only the file bin/npm (without extension) directly on the node folder.
  7. Add the the node folder and the packages/bin folder to PATH
  8. On a command prompt execute npm install -g npm to update npm to the latest version

Now you can use npm and node from windows cmd or from bash shell like Git Bash of msysgit.

@carstene1ns
carstene1ns / dump_romfs.rb
Created April 26, 2018 21:40
Simple tool to get a romFS image out of a .NRO file
#!/usr/bin/env ruby
#
# dump_romfs.rb by carstene1ns, 2018 - under ISC License
#
# See http://switchbrew.org/index.php?title=NRO for reference
MAGIC = "NRO0"
HEADER = "ASET"
# helper
###############################################
# TX SX OS unpacker - by hexkyz and naehrwert #
###############################################
from Crypto.Cipher import AES
from Crypto.Util import Counter
import os
import struct
"""
###############################################
# TX SX Pro Custom Payload Packer - by CTCaer #
###############################################
import struct
import hashlib
from os import unlink
"""
typedef struct boot_dat_hdr
# The following is adapted from https://github.com/reswitched/loaders/blob/master/nxo64.py
#
# ===========================================================================================
#
# Copyright 2017 Reswitched Team
#
# Permission to use, copy, modify, and/or distribute this software for any purpose with or
# without fee is hereby granted, provided that the above copyright notice and this permission
# notice appear in all copies.
#
###############################################
# TX SX Pro Custom Payload Packer - by CTCaer #
# Forked by AveSatanas to add argparse #
###############################################
import struct
import hashlib
import argparse
parser = argparse.ArgumentParser()
#!/usr/bin/env bash
HACTOOL=./hactool.exe
UPDATES=`find . ! -name . -type d`
for updates in $UPDATES; do
updates=`basename $updates`
NCA=`find $updates -name '*.cnmt.nca'`
for nca in $NCA; do
TITLEID=`$HACTOOL -k keys.txt -t nca --listromfs $nca | grep "Title ID:" | grep 0100000000000809 | tr -s ' ' | cut -d' ' -f3`
@65c22
65c22 / tuto_resize_user_emummc.md
Last active January 26, 2020 13:26
[Tuto] Redimensionner partition USER pour emuMMC Atmosphère

Tutoriel - Redimensionner la partition USER d'un dump de NAND (pour emuMMC Atmosphère)

Introduction

Introduction:

Ce tutoriel va intéresser les amateurs de l'emuMMC intégré dernièrement au CFW Atmosphère. En effet, vous avez maintenant la possibilité sur AMS de lancer une NAND "alternatif" stockée sur votre carte SD (au lieu d'utiliser celle sur la puce mémoire de votre switch appellé sysNAND). Le redimensionnement de la partition USER (qui contient vos données utilisateur) est utile dans le cas d'un emuMMC/emuNAND pour récupérer une partie du stockage perdu (en moyenne 20Go), en effet il est inutile d'avoir un emuMMC de 32Go puisque vous installez tous vos jeux dans la SD et le dossier Nintendo.

Pour se faire nous allons avoir besoin d'un dump de NAND que vous pouvez réaliser de différentes manières (les tutoriels ne manquent pas sur le forum), j'ai personnellement utiliser la méthode Hekate. Mais à la fin vous obtenez tous les fichiers RAWNAND.bin BOOT0 et BOOT1, pour la méthode que je vais vous

@igoticecream
igoticecream / amiibo.py
Last active May 24, 2020 11:02
Retrieve all Amiibos from AmiiboApi into Emuiibo compatible files
#!/usr/bin/env python3
from pathlib import Path
import struct
import json
import random
import datetime
import re
import requests