Skip to content

Instantly share code, notes, and snippets.

View PabloCastellano's full-sized avatar
:octocat:

Pablo Castellano PabloCastellano

:octocat:
View GitHub Profile
@PabloCastellano
PabloCastellano / sql.diff
Created July 8, 2023 10:21
Differences between staging and production blobscan db schema
--- staging.sql 2023-07-08 12:19:13.712663068 +0200
+++ production.sql 2023-07-08 12:20:09.848668875 +0200
@@ -41,9 +41,9 @@
id text NOT NULL,
"versionedHash" text NOT NULL,
commitment text NOT NULL,
+ size integer NOT NULL,
"gsUri" text NOT NULL,
- "swarmHash" text,
- size integer NOT NULL
@PabloCastellano
PabloCastellano / network_device_status.json
Created July 17, 2020 10:11
ubus calls in OpenWrt 19.07.3
{
"br-lan": {
"external": false,
"present": true,
"type": "bridge",
"up": true,
"carrier": true,
"bridge-members": [
"eth0.1"
],
From be14a14de0409ef2b3627c04dcbd25660103c455 Mon Sep 17 00:00:00 2001
From: Pablo Castellano <pablo@anche.no>
Date: Mon, 25 May 2020 19:43:33 +0200
Subject: [PATCH 1/3] Last changes
---
openwisp_monitoring/device/api/views.py | 9 ++++++---
openwisp_monitoring/monitoring/charts.py | 19 +++++++++++--------
2 files changed, 17 insertions(+), 11 deletions(-)
From be14a14de0409ef2b3627c04dcbd25660103c455 Mon Sep 17 00:00:00 2001
From: Pablo Castellano <pablo@anche.no>
Date: Mon, 25 May 2020 19:43:33 +0200
Subject: [PATCH 1/3] Last changes
---
openwisp_monitoring/device/api/views.py | 9 ++++++---
openwisp_monitoring/monitoring/charts.py | 19 +++++++++++--------
2 files changed, 17 insertions(+), 11 deletions(-)
@PabloCastellano
PabloCastellano / With SAMPLE_APP=1
Created May 12, 2020 17:36
Different SQL queries in openwisp-firmware-upgrader issue 53
SELECT "authtoken_token"."key", "authtoken_token"."user_id", "authtoken_token"."created", "openwisp_users_user"."password", "openwisp_users_user"."last_login", "openwisp_users_user"."is_superuser", "openwisp_users_user"."username", "openwisp_users_user"."first_name", "openwisp_users_user"."last_name", "openwisp_users_user"."is_staff", "openwisp_users_user"."is_active", "openwisp_users_user"."date_joined", "openwisp_users_user"."id", "openwisp_users_user"."email", "openwisp_users_user"."bio", "openwisp_users_user"."url", "openwisp_users_user"."company", "openwisp_users_user"."location", "openwisp_users_user"."phone_number" FROM "authtoken_token" INNER JOIN "openwisp_users_user" ON ("authtoken_token"."user_id" = "openwisp_users_user"."id") WHERE "authtoken_token"."key" = '30ce80ab05b3098e080f27768efc4ae6e19f4052' LIMIT 21
SELECT "openwisp_users_organization"."name", "openwisp_users_organization"."is_active", "openwisp_users_organization"."created", "openwisp_users_organization"."modified", "openwisp_users_organ
@PabloCastellano
PabloCastellano / dump.sh
Last active January 20, 2019 19:39 — forked from andsens/dump.sh
Backup all MySQL databases into separate files
#!/bin/sh
## backup each mysql db into a different file, rather than one big file
## as with --all-databases. This will make restores easier.
## To backup a single database simply add the db name as a parameter (or multiple dbs)
## Putting the script in /var/backups/mysql seems sensible... on a debian machine that is
## Create the user and directories
# mkdir -p /var/backups/mysql/databases
# useradd --home-dir /var/backups/mysql --gid backup --no-create-home mysql-backup
## Remember to make the script executable, and unreadable by others
@PabloCastellano
PabloCastellano / prompts.md
Last active June 6, 2018 22:09
GitHub prompts

Prompts

Prompt #1

  • Company: Acme Computers Inc.
  • Version Control platform(s): Many GitHub Enterprise instances installed throughout the company by different teams. Acme Computers is trying to standardize on GitHub Enterprise and consolidate their GitHub usage onto a single instance. The company has many instances of other Git hosting solutions installed as well. Some are fully supported applications. Other instances are on machines under peope's desks.
  • Performance: The single instance of GitHub Enterprise occassionally has reports from users of being slow. There are 5,000 of the likely 20,000 total users on the instance at this point. There are a few problematic repositories that seem especially slow. One repository was shrunk from 70GB as a Subversion repository to 7GB as a Git repository after some cleanup. However, this repository is still taking very long to clone and for other simple Git operations.
  • Customer requests:

Acme wants GitHub to help them shrink the large repository to a more man

@PabloCastellano
PabloCastellano / gist:eb2e6e2ab4568c3f60fa921ba04dfc10
Created June 22, 2017 20:48
postmarketOS: dmesg after show_splash in Moto G 2014 (titan)
[ 149.230230,0] mdss_fb_alloc_fb_ion_memory: alloc 0x398000B vaddr = e7799000 (0x00200000 iova) for fb0
[ 149.230422,0] vm_start=b6abd000 vm_end=b6e55000 vm_page_prot=1799
[ 149.230693,0] vm_start=b6abd000 vm_end=b6e55000 vm_page_prot=1799
[ 149.230879,0] vm_start=b6abd000 vm_end=b6e55000 vm_page_prot=1799
[ 149.231060,0] vm_start=b6abd000 vm_end=b6e55000 vm_page_prot=1799
[ 149.231178,0] vm_start=b6abd000 vm_end=b6e55000 vm_page_prot=1799
[ 149.231357,0] vm_start=b6abd000 vm_end=b6e55000 vm_page_prot=1799
[ 149.231474,0] vm_start=b6abd000 vm_end=b6e55000 vm_page_prot=1799
[ 149.231655,0] vm_start=b6abd000 vm_end=b6e55000 vm_page_prot=1799
[ 149.231773,0] vm_start=b6abd000 vm_end=b6e55000 vm_page_prot=1799
@PabloCastellano
PabloCastellano / gist:0ca1b35d67c064b397141cafd5d111ca
Last active June 22, 2017 19:26
Flashing pmOS into Moto G 2014 (titan)
pablo@pablo-sch ~/src/pmbootstrap $ ./pmbootstrap.py flasher flash_system
[20:40:33] (native) flash system image
(bootloader) has-slot:system: not found
target reported max download size of 536870912 bytes
Invalid sparse file format at header magi
sending sparse 'system' 1/1 (210933 KB)...
OKAY [ 7.412s]
writing 'system' 1/1...
OKAY [ 10.429s]
finished. total time: 17.840s
@PabloCastellano
PabloCastellano / libbitcoin_packages_ubuntu.sh
Created June 17, 2016 13:48
libbitcoin_packages_debian.sh
#
# libbitcoin version 2 Debian packaging script
# Tested on Debian 8.3
#
export PACKAGES_DIR=$HOME
cd $PACKAGES_DIR
apt-get install sudo
sudo apt-get install -y libtool autoconf make pkg-config libtool-bin devscripts dh-autoreconf git quilt