Skip to content

Instantly share code, notes, and snippets.

# List block devices
lsblk
# Umount.
# You should replace <?> by letter or number
sudo umount /dev/sd<?><?>
# This is a destructive command and wipes the entire USB drive with the contents of the iso, so be careful
sudo dd bs=4M if=path/to/input.iso of=/dev/sd<?> conv=fdatasync status=progress
@alvmgdev
alvmgdev / InAppBrowser.java
Created March 11, 2020 12:59 — forked from HugoGresse/InAppBrowser.java
Cordova inapp browser plugin to open the camera
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@alvmgdev
alvmgdev / bulkCommitRename.sh
Last active February 5, 2020 20:29
git rebase -i <initial_commit_hash_to_rebase> -x <full_path_to_bulkCommitRename.sh>
#!/bin/bash
# Author: Alvaro Merino Garcia
# The purpose of this script is to use it as param of rebase -x "this script using full path"
# to process a bulk rename of commits
STRING_TO_BE_REPLACED="STRY0000000"
DESIRED_STRING_USING_IN_REPLACE="STRY1111111"
# Retrieve actual commit message using git log -1
COMMIT_MSG="$(git log --pretty=format:%s -1)"
@alvmgdev
alvmgdev / relations.py
Created August 21, 2019 10:26 — forked from cyrexcyborg/relations.py
Flask-Admin-SQLAlchemy one-to-one, one-to-many between two tables
# -*- coding: utf-8 -*-
# Many thanks to http://stackoverflow.com/users/400617/davidism
# This code under "I don't care" license
# Take it, use it, learn from it, make it better.
# Start this from cmd or shell or whatever
# Go to favourite browser and type localhost:5000/admin
import sys
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.admin import Admin
@alvmgdev
alvmgdev / consumer_ps3838_api.py
Last active March 16, 2025 21:56
Script to connect to ps3838 API
import base64
import requests
from enum import Enum
"""
Script to connect to ps3838 API
URL to check API User Guide:
https://www.tender88.com/static/index.php/es-es/help/api-user-guide-es-es
@alvmgdev
alvmgdev / autorenew-letsencrypt-certs-and-reload-nginx
Created October 9, 2018 01:24
Crontab entry to auto renew letsencrypt certificates (certbot) and reload nginx
MAILTO=youremailhere
@daily certbot renew --quiet && systemctl reload nginx
@alvmgdev
alvmgdev / supreme-captcha-harvester.js
Created August 17, 2018 08:18 — forked from samjmck/supreme-captcha-harvester.js
Captcha harvesting for Supreme example
'use strict';
const {Harvester} = require('captcha-manager');
const request = require('request-promise-native');
const harvester = new Harvester();
const availableCaptchaResponseTokens = [];
const siteKey = '6LeWwRkUAAAAAOBsau7KpuC9AV-6J8mhw4AjC3Xz';