Skip to content

Instantly share code, notes, and snippets.

View baltpeter's full-sized avatar

Benjamin Altpeter baltpeter

View GitHub Profile
@baltpeter
baltpeter / index.mjs
Created June 16, 2022 21:04
Play Store batchexecute request for top charts, cleaned up (step 2)
import fetch from 'cross-fetch';
(async () => {
const language = 'en';
const country = 'de';
const length = 2;
const chart_name = 'topselling_free';
const category_id = 'APPLICATION';
const res = await fetch(`https://play.google.com/_/PlayStoreUi/data/batchexecute?hl=${language}&gl=${country}`, {
@baltpeter
baltpeter / res.json
Created June 16, 2022 20:29
Play Store batchexecute response for top charts, formatted
This file has been truncated, but you can view the full file.
[
[
"wrb.fr",
"vyAe2",
[
[
null,
[
[
null,
@baltpeter
baltpeter / index.mjs
Last active June 16, 2022 20:05
Play Store batchexecute request for top charts, cleaned up (step 1)
import fetch from 'cross-fetch';
(async () => {
const res = await fetch('https://play.google.com/_/PlayStoreUi/data/batchexecute', {
headers: {
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
},
body: `f.req=${JSON.stringify([
[
[
@baltpeter
baltpeter / index.mjs
Created June 16, 2022 19:29
Play Store batchexecute request for top charts
import fetch from 'cross-fetch';
(async () => {
// This request is exactly replicated from what the Play Store website does.
const res = await fetch(
'https://play.google.com/_/PlayStoreUi/data/batchexecute?rpcids=vyAe2&source-path=%2Fstore%2Fapps&f.sid=-7855711026347449501&bl=boq_playuiserver_20220612.08_p0&hl=en&authuser&soc-app=121&soc-platform=1&soc-device=1&_reqid=74074&rt=c',
{
credentials: 'include',
headers: {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0',
@baltpeter
baltpeter / keybindings.json
Created March 3, 2020 21:25
VS Code keyboard shortcuts
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "ctrl+d",
"command": "-editor.action.addSelectionToNextFindMatch",
"when": "editorFocus"
},
{
"key": "ctrl+up",
"command": "-scrollLineUp",
@baltpeter
baltpeter / script-bash.sh
Created January 21, 2017 19:04
Create 100 files with random hex-like filenames and random binary content
for n in {1..100}; do
dd if=/dev/urandom of=$( cat /dev/urandom | tr -cd 'a-f0-9' | head -c 6 ) bs=1 count=$(( RANDOM + 1024 ))
done
@baltpeter
baltpeter / config
Created July 10, 2015 21:06
Proxmox Reverse Proxy with Nginx
server {
listen 443;
server_name pve.mydomain.com;
ssl on;
ssl_certificate /etc/nginx/ssl/ssl.crt;
ssl_certificate_key /etc/nginx/ssl/ssl.key;
proxy_redirect off;
location / {
@baltpeter
baltpeter / keybase.md
Created January 7, 2015 15:50
keybase.md

Keybase proof

I hereby claim:

  • I am baltpeter on github.
  • I am baltpeter (https://keybase.io/baltpeter) on keybase.
  • I have a public key whose fingerprint is 0903 DEF9 C683 8D77 4EC7 3A8E 580B 1C78 00EB 2372

To claim this, I am signing this object:

@baltpeter
baltpeter / script.sh
Created November 6, 2014 17:25
Format 2 TB+ disks using parted (GPT)
# To create a partition start GNU parted as follows:
parted /dev/sdb
# Create a new GPT disklabel i.e. partition table:
mklabel gpt
yes
# Next, set the default unit to TB, enter:
unit TB
@baltpeter
baltpeter / script.sh
Created November 4, 2014 19:34
Replace all occurrences of `wrong` with `right` in all files matching `*.txt` in a directory
sed -i '' 's/wrong/right/g' *.txt