Skip to content

Instantly share code, notes, and snippets.

@verNANDo57
verNANDo57 / 8GB_android-11_compilation-note
Last active November 14, 2023 20:04
Workarounds for building Android 11 on 8GB RAM
Workarounds for building R on 8GB RAM environment:
1. At the start of the build:
[ 99% 138/139] /mnt/ssd/lineage/out/soong/.bootstrap/bin/soong_build /mnt/ssd/lineage/out/soong/build.ninja
This used to take around 30mins, after enabling zram now it takes around 30secs (thanks to @kdrag0n for the zram idea) which is on par with what happens in 16GB RAM building environments
sudo apt install zram-config for installing zram-config package
sudo nano /etc/fstab and add a # in front of the swap disk if you have one and then reboot
After booting cat /proc/swaps to check if zram is enabled or not
@andrebrait
andrebrait / keychron_linux.md
Last active November 7, 2024 08:48
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.

@timetorock
timetorock / jquery.nice-select-with-search-multiple.js
Created February 24, 2019 14:35
nice-select-with-search-multiple
/* jQuery Nice Select - v1.1.0
https://github.com/hernansartorio/jquery-nice-select
Made by Hernán Sartorio */
(function($) {
$.fn.niceSelect = function(method) {
// Methods
if (typeof method == 'string') {
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active November 16, 2024 18:12
set -e, -u, -o, -x pipefail explanation
@Brainiarc7
Brainiarc7 / fix-intel_wifi_aer-avell_g1513_fire_v3
Created July 16, 2018 13:21 — forked from flisboac/ fix-intel_wifi_aer-avell_g1513_fire_v3
Temporary fix for AER's excessive `severity=Corrected` logging for Intel Wireless (Avell G1513 Fire V3) (Arch Linux)
silly gist hack, why do we need you? :(
@2E0PGS
2E0PGS / linux-usb-file-copy-fix.md
Last active November 16, 2024 17:56
Fix Ubuntu and other Linux slow/hanging file copying via USB.

If your running a x64 bit Ubuntu or other Linux and find USB transfers hang at the end apply this fix:

echo $((16*1024*1024)) > /proc/sys/vm/dirty_background_bytes
echo $((48*1024*1024)) > /proc/sys/vm/dirty_bytes

I suggest you edit your /etc/rc.local file to make this change persistant across reboots.

sudo nano /etc/rc.local

@weibeld
weibeld / set_prompt.sh
Created December 10, 2015 10:54
Bash Prompt With Exit Code of Last Command
# Set a Bash prompt that includes the exit code of the last executed command.
#
# Setup: paste the content of this file to ~/.bashrc, or source this file from
# ~/.bashrc (make sure ~/.bashrc is sourced by ~/.bash_profile or ~/.profile)
#
# Daniel Weibel <[email protected]> October 2015
#------------------------------------------------------------------------------#
# Command that Bash executes just before displaying a prompt
export PROMPT_COMMAND=set_prompt
#!/bin/bash
set -e
if [ $UID -ne 0 ]
then
sudo $0
fi
readonly BAT_LIMIT_PATH=/sys/devices/platform/sony-laptop/battery_care_limiter
readonly USB_CHARGE_PATH=/sys/devices/platform/sony-laptop/usb_charge
@goodevilgenius
goodevilgenius / membash.sh
Last active November 2, 2023 12:19 — forked from ri0day/memcache_cli.sh
[membash] BASH script which may be used to interact with memcache. All main memcache functions are supported. #memcache
#!/bin/bash
# Gist: 11375877
# Url: https://gist.github.com/goodevilgenius/11375877
#
# All memcache functions are supported.
#
# Can also be sourced from other scripts, e.g.
# source membash.sh
# MCSERVER="localhost"
@nelstrom
nelstrom / vim-plugin-directories
Created June 30, 2011 11:32
An overview of what belongs in each directory of a Vim plugin.
plugin
naming convention: name_of_plugin.vim
these files are sourced for all file types
doc
naming convention: name_of_plugin.txt
these files document the functionality of a plugin
color
naming convention: name_of_colorscheme.vim