Skip to content

Instantly share code, notes, and snippets.

@mss
mss / zoom-pulse-prop-media-role-phone-wrapper-installer.sh
Last active April 16, 2024 08:11
Make the Ubuntu Zoom client automatically switch Bluetooth headset profiles to HSP/HFP
#!/bin/bash
# This is a hack to make Bluetooth headests like the jabra Evolve 65 actually
# work as a headset with the Linux (Ubuntu/Debian) Zoom client without having
# to switch manually from A2DP to the HSP/HFP profile.
#
# This is done by injecting an environment variable which makes PulseAudio
# recognize the application as a telephony/voice application as described
# here:
# * https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Bluetooth/#profiles
# * https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/Developer/Clients/ApplicationProperties/#pa_prop_media_role
@Cortexelus
Cortexelus / udio.py
Last active April 16, 2024 08:11
Automate Udio (2024-04-13)
# AUTOMATE UDIO
# by DADABOTS dadabots.com
# was working on 2024-04-13
# tldr; get your login cookie, use it to automate udio from python
import requests
import json
from time import sleep
import re
@Era-Dorta
Era-Dorta / create-efi-keys.sh
Last active April 16, 2024 08:10
Sign kernel modules on Ubuntu, useful for Nvidia drivers in UEFI system
# VERY IMPORTANT! After each kernel update or dkms rebuild the modules must be signed again with the script
# ~/.ssl/sign-all-modules.sh
# Place all files in ~/.ssl folder
mkdir ~/.ssl
cd ~/.ssl
# Generate custom keys with openssl
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -subj "/CN=Owner/"
@chatton
chatton / SendStringOverSocket.java
Last active April 16, 2024 08:10
Example of sending a String through a Socket in Java.
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
public class Client {
public static void main(String[] args) throws IOException {
// need host and port, we want to connect to the ServerSocket at port 7777
Socket socket = new Socket("localhost", 7777);
System.out.println("Connected!");
@ymoslem
ymoslem / M2M-100-example.py
Last active April 16, 2024 08:09
Example of translating a file with M2M-100 using CTranslate2
# This example uses M2M-100 models converted to the CTranslate2 format.
# Download CTranslate2 models:
# • M2M-100 418M-parameter model: https://bit.ly/33fM1AO
# • M2M-100 1.2B-parameter model: https://bit.ly/3GYiaed
import ctranslate2
import sentencepiece as spm
@u9O
u9O / README.md
Last active April 16, 2024 08:06
The Essential Skills to Becoming a Master Hacker

The Fundamental Skills

These are the basics that every hacker should know before even trying to hack. Once you have a good grasp on everything in this section, you can move into the intermediary level.

1Basic Computer Skills

It probably goes without saying that to become a hacker you need some basic computer skills. These skills go beyond the ability to create a Word document or cruise the Internet. You need to be able to use the command line in Windows, edit the registry, and set up your networking parameters.

Many of these basic skills can be acquired in a basic computer skills course like A+.

@nstarke
nstarke / release-android-debuggable.md
Last active April 16, 2024 08:06
How to make a Release Android App debuggable

How to make a Release Android App debuggable

Let's say you want to access the application shared preferences in /data/data/com.mypackage.
You could try to run adb shell and then run-as com.mypackage ( or adb shell run-as com.mypackge ls /data/data/com.mypackage/shared_prefs), but on a production release app downloaded from an app store you're most likely to see:

run-as: Package 'com.mypackage' is not debuggable
@jacobdepriest
jacobdepriest / codespaces-and-jekyll.md
Last active April 16, 2024 08:02
Using GitHub Codespaces to edit a Jekyll Static Site

Using GitHub Codespaces is my new default for editing a static Jekyll site

  1. Navigate to a repo where you have your Jekyll static site (maybe your GitHub pages site)
  2. Launch Codespaces (Code button -> Cloud -> New codespace on current branch)
  3. Once it's launched, run the following in the terminal
gem install bundler jekyll
bundle update
bundle exec jekyll serve
BenchmarkSend/128-24 200000 5788 ns/op
BenchmarkSend/128#01-24 1000000 2053 ns/op
BenchmarkSend/256-24 100000 10465 ns/op
BenchmarkSend/256#01-24 500000 3311 ns/op
BenchmarkSend/512-24 100000 18025 ns/op
BenchmarkSend/512#01-24 200000 6123 ns/op
BenchmarkSend/1024-24 30000 36596 ns/op
BenchmarkSend/1024#01-24 100000 11584 ns/op
BenchmarkSend/2048-24 20000 64805 ns/op
BenchmarkSend/2048#01-24 50000 22978 ns/op
//------------------------------------------------------------------------
// The SwiftUI Lab: Advanced SwiftUI Animations
// https://swiftui-lab.com/swiftui-animations-part1 (Animating Paths)
// https://swiftui-lab.com/swiftui-animations-part2 (GeometryEffect)
// https://swiftui-lab.com/swiftui-animations-part3 (AnimatableModifier)
//------------------------------------------------------------------------
import SwiftUI
struct ContentView: View {