Skip to content

Instantly share code, notes, and snippets.

View figassis's full-sized avatar

Assis Ngolo figassis

View GitHub Profile
@moyix
moyix / killbutmakeitlooklikeanaccident.sh
Created February 5, 2022 22:51
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
Rank Type Prefix/Suffix Length
1 Prefix my+ 2
2 Suffix +online 6
3 Prefix the+ 3
4 Suffix +web 3
5 Suffix +media 5
6 Prefix web+ 3
7 Suffix +world 5
8 Suffix +net 3
9 Prefix go+ 2
@fnky
fnky / stripe-keys-and-ids.tsv
Last active July 24, 2024 23:23
Stripe keys and IDs
Prefix Description Notes
ac_ Platform Client ID Identifier for an auth code/client id.
acct_ Account ID Identifier for an Account object.
aliacc_ Alipay Account ID Identifier for an Alipay account.
ba_ Bank Account ID Identifier for a Bank Account object.
btok_ Bank Token ID Identifier for a Bank Token object.
card_ Card ID Identifier for a Card object.
cbtxn_ Customer Balance Transaction ID Identifier for a Customer Balance Transaction object.
ch_ Charge ID Identifier for a Charge object.
cn_ Credit Note ID Identifier for a Credit Note object.
@holmberd
holmberd / php-pools.md
Last active July 23, 2024 15:06
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
@grimzy
grimzy / git-pull-all
Created September 15, 2017 02:15
Git pull all remote branches
#!/usr/bin/env bash
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
- Install local dashcore version.
- Create dash.conf file in .dashcore with data allowing to be requested by RPC (server=1, rpcport,... - You can use exemple [REF1] below)
- Start dashd by simply call for ./bin/dashd
- Then in another folder (insight?) do a git clone https://github.com/dashevo/bitcore-node-dash -b skip-dash-download
- cd bitcore-node-dash
- npm install
- npm install insight-api-dash --S
- npm install insight-ui-dash --S
<?
$entities = array('image', 'photo', 'text', 'source', 'site', 'traffic', 'money', 'book', 'e-book', 'file', 'smartphone', 'camera', 'notebook', 'cities', 'distances', 'cars', 'mobile', 'book', 'sex', 'love', 'classifieds', 'ads', 'alcohol', 'travel');
$verbs = array('sell', 'buy', 'rent', 'exchange', 'free', 'give', 'book', 'clean', 'find', 'classify', 'compare');
echo '<table style="width: 100%">';
foreach ($entities as $entity)
{
echo '<tr>';
foreach ($verbs as $verb)
echo "<td style='font-size: 14px; padding: 5px; text-align: center'>$verb $entity</td>";
echo '</tr>';
@gurisko
gurisko / functionName.js
Last active May 11, 2024 05:41
[NodeJS] Get the current function name or any other function while using strict mode
'use strict';
const findFirstOccurrence = (string, searchElements, fromIndex = 0) => {
let min = string.length;
for (let i = 0; i < searchElements.length; i += 1) {
const occ = string.indexOf(searchElements[i], fromIndex);
if (occ !== -1 && occ < min) {
min = occ;
}
}
@VojtechVitek
VojtechVitek / slice-batch-in-parallel.go
Last active December 25, 2023 09:42
Golang - Loop over slice in batches (run something in parallel on a sub-slice)
package main
import "fmt"
func main() {
slice := make([]int, 159)
// Split the slice into batches of 20 items.
batch := 20