Skip to content

Instantly share code, notes, and snippets.

@caarmen
caarmen / swapi-graphql-client.py
Last active May 22, 2022 16:20
Script to retrieve paginated data from the star wars graphql server.
"""
Exploration of a graphql client in Python
"""
import asyncio
from dataclasses import dataclass
from typing import Generator
from gql import gql
from gql.client import Client, AsyncClientSession
from gql.transport.aiohttp import AIOHTTPTransport
@caarmen
caarmen / reinstall-mariadb-mysql.txt
Last active May 20, 2022 15:12
reinstall mariadb/mysql on mac
Remove contents of /usr/local/var/mysql
brew uninstall mysql
brew uninstall mariadb
brew install mariadb
mysql_install_db
mysql.server start
sudo mysql
- this opens a session. Just exit mysql for now
mysql_secure_installation
- Answer yes to everything
Language feature Kotlin Scala
val hello="foo"
@caarmen
caarmen / adball.bash
Last active July 23, 2016 22:50
adb-all bash function
#test
adb-all()
{
adb devices | while read line
do
if [ ! "$line" = "" ] && [ `echo $line | awk '{print $2}'` = "device" ]
then
device=`echo $line | awk '{print $1}'`
echo "$device:"
adb -s $device $@
@caarmen
caarmen / genymotion_rotate.sh
Created June 3, 2016 09:17
Rotate genymotion in a loop
x=0
while [ 1 ]
do
x=`expr \( $x + 90 \) % 360 `
/Applications/Genymotion\ Shell.app/Contents/MacOS/genyshell -c "rotation setangle $x"
sleep 1
done
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
@caarmen
caarmen / loopback.md
Created January 20, 2016 15:57
Creating a loopback filesystem
@caarmen
caarmen / docker.md
Last active January 20, 2016 15:41
Docker info

Start/stop: systemctl restart docker

systemctl stop docker

systemctl start docker

systemctl daemon-reload (do this after changing docker config)

Config: /lib/systemd/system/docker.service

@caarmen
caarmen / gpg.txt
Last active April 23, 2023 07:28
use gpg to encrypt a file with a password
gpg -c --cipher-algo AES256 --symmetric mysecretlife.doc