Skip to content

Instantly share code, notes, and snippets.

View artynet's full-sized avatar

Arturo Rinaldi artynet

View GitHub Profile
@artynet
artynet / ro-root.sh
Created June 8, 2022 14:24 — forked from paul-ridgway/ro-root.sh
A scrip to replace the default RPi init to create and chroot to an overlayfs-backed root
#!/bin/sh
# Read-only Root-FS for Raspian using overlayfs
# Version 1.1:
# Changed to use /proc/mounts rathern than /etc/fstab for deriving the root filesystem.
#
# Version 1:
# Created 2017 by Pascal Suter @ DALCO AG, Switzerland to work on Raspian as custom init script
# (raspbian does not use an initramfs on boot)
#
@artynet
artynet / reset_usb_device.py
Created March 24, 2022 16:16 — forked from willstott101/reset_usb_device.py
Disable and enable a specific USB device.
#! /usr/bin/python3
import os
import argparse
from time import sleep
PATH = '/sys/bus/usb/devices/'
def reset_device(key, value, coerce, sleep_time):
for device_dir, dirs, files in os.walk(PATH, followlinks=True):
if device_dir != PATH:
#!/bin/bash
# URL : https://stackoverflow.com/questions/48400287/git-format-patch-for-all-the-commits-to-a-file
COUNTER=${2};
for c in `git log --format="%H" -- ${1} | head -n ${2}`;do
git format-patch --start-number=$COUNTER "$c^1".."$c" -o patches
let COUNTER=COUNTER-1
done
#############
### ILIAD ###
#############
config interface 'wan3g'
option ifname 'modem'
option proto 'qmi'
option apn 'iliad'
option pincode '1234'
option autoconnect '1'
@artynet
artynet / gist:7812287783985d97e438b3dc502c4042
Created June 9, 2020 15:33 — forked from yano3/gist:1378948
git commit --amend --reset-author
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email you@example.com
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
@artynet
artynet / find-replace-in-file-recursive-regex.py
Created May 24, 2020 21:53 — forked from glowinthedark/find-replace-in-file-recursive-regex.py
Recursively find and replace text in files under a specific folder with colorized preview of changed data in dry-run mode
#!/usr/bin/env python
"""
Recursively find and replace text in files under a specific folder with preview of changed data in dry-run mode
============
Example Usage
---------------
**See what is going to change (dry run):**
@artynet
artynet / cu-serial-port-setup.txt
Last active March 10, 2020 01:05
setting to get the keystroke working in serial port
# https://access.redhat.com/solutions/209663
# /etc/uucp/port
# disabling hw flow control for missing keystroke input
# Everything after a '#' character is a comment.
port ttyUSB0 # Port name
type direct # Direct connection to other system
device /dev/ttyUSB0 # Port device node
hardflow false # No hardware flow control
speed 115200 # Line speed
@artynet
artynet / blacklist-nouveau-alt.conf
Last active February 9, 2024 19:59
setting to blacklist nouveau drivers
Hi guys! I've made this tutorial cuz my Driver Manager wasn't working well, hope it helps:
1 Obviously starting with an update and upgrade:
sudo apt-get update && sudo apt-get upgrade
2 Then remove all Nvidia packages, skip this if your OS is fresh installed:
sudo apt-get remove nvidia* && sudo apt autoremove
#
# ALSA library configuration file
#
# pre-load the configuration files
@hooks [
{
func load
files [
pcm.!default {
type asym
playback.pcm {
type plug
slave.pcm "hw:0,0"
}
capture.pcm {
type plug
slave.pcm "hw:1,0"
}