Skip to content

Instantly share code, notes, and snippets.

View simonesestito's full-sized avatar
🇮🇹

Simone Sestito simonesestito

🇮🇹
View GitHub Profile
@simonesestito
simonesestito / use_dual_monitor_speakers.sh
Created January 19, 2024 08:37
PulseAudio: use multiple speakers
#!/bin/bash
# TODO: Update this strings with the actual values for your speakers
# TODO: Remember to also adjust the volumes to balance them (depending on their power and their distance from your location)
SPEAKER_1_NAME=alsa_output.pci-0000_03_00.1.hdmi-stereo
SPEAKER_1_VOLUME=80%
SPEAKER_2_NAME=alsa_output.pci-0000_03_00.6.analog-stereo
SPEAKER_2_VOLUME=100%
# Initially, remove previous state
@simonesestito
simonesestito / README.md
Last active April 15, 2024 12:35
eduroam connection fix

Error

journalctl --boot --unit wpa_supplicant.service --follow

wpa_supplicant[888]: SSL: SSL3 alert: write (local SSL3 detected an error):fatal:protocol version

wpa_supplicant[888]: OpenSSL: openssl_handshake - SSL_connect error:0A000102:SSL routines::unsupported protocol

That may indicate that the network you're trying to connect to, requires some very old protocols.

@simonesestito
simonesestito / main.go
Last active January 7, 2023 09:51
CFG derivation tester
package main
import (
"fmt"
"strings"
)
func main() {
// ! Edit grammar
cfg := NewGrammar('S', map[byte]Rule{
@RebelLion420
RebelLion420 / TermuxArchSetup2020.md
Last active June 30, 2024 03:57
How to set up Arch Linux in Termux on Android

So, to get started you need to get the base OS installed using the instructions from the official docs .

$ pkg update

$ pkg install bsdtar wget proot tergent tmux openssh

Tmux is a multiplexer that lets you run multiple persistent windows and sessions on a single terminal. I had trouble getting it working in the Arch proot, so a workaround is configuring tmux from your host Termux and then creating a tmux session and starting the chroot from there. For more information on using tmux read this article, and to learn how to customize the appearance and behaviors more try this one as well as looking at the tmux-plugins Github organization for community-built add-ons.

$ termux-setup-storage

@diffficult
diffficult / installing_virt_manager.md
Last active June 1, 2024 13:53
Easy instructions to get virt-manager qemuv/kvm running on Arch

Easy instructions to get QEMU/KVM and virt-manager up and running on Arch

  1. Make sure your cpu support kvm with below command:

     grep -E "(vmx|svm)" --color=always /proc/cpuinfo
    
  2. Make sure BIOS have enable “Virtualization Technology”.

  3. User access to /dev/kvm so add your account into kvm(78) group:

@ibrahimsn98
ibrahimsn98 / android-get-apps-adaptive-icons-circle
Created January 27, 2018 21:04
Android - Get aplication's adaptive icons in circle form
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.drawable.AdaptiveIconDrawable;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import android.os.Build;
@nishantmodak
nishantmodak / nginx.conf.default
Last active May 26, 2024 19:29
Default Nginx Conf
#user nobody;
#Defines which Linux system user will own and run the Nginx server
worker_processes 1;
#Referes to single threaded process. Generally set to be equal to the number of CPUs or cores.
#error_log logs/error.log; #error_log logs/error.log notice;
#Specifies the file where server logs.
@burgalon
burgalon / AccountAuthenticator.java
Last active July 15, 2023 08:29
Implementing OAuth2 with AccountManager, Retrofit and Dagger
public class AccountAuthenticator extends AbstractAccountAuthenticator {
private final Context context;
@Inject @ClientId String clientId;
@Inject @ClientSecret String clientSecret;
@Inject ApiService apiService;
public AccountAuthenticator(Context context) {
super(context);