Skip to content

Instantly share code, notes, and snippets.

@ANRCorleone
ANRCorleone / readme.txt
Last active June 20, 2024 11:38 — forked from krisalyssa/readme.txt
Ubuntu 22.04 + Hyper V + Enhanced Session mode + XRDP PulseAudio
Credits
# https://c-nergy.be/blog/?p=13655
# https://askubuntu.com/questions/844245/how-to-compile-latest-pulseaudio-with-webrtc-in-ubuntu-16-04
# https://askubuntu.com/questions/496549/error-you-must-put-some-source-uris-in-your-sources-list
# https://unix.stackexchange.com/questions/65167/enable-udev-and-speex-support-for-pulseaudio
# https://rudd-o.com/linux-and-free-software/how-to-make-pulseaudio-run-once-at-boot-for-all-your-users
# https://gist.github.com/rkttu/35ecab5604c9ddc356b0af4644d5a226
# Installation and Enhanced session
# follow steps on the post below, I installed Ubuntu 22.04 on a Windows 11 machine
@andrebrait
andrebrait / keychron_linux.md
Last active June 26, 2024 03:35
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.

# install current version of cwbtools
library(drat)
drat::addRepo("polmine")
install.packages("cwbtools")
# Reencode installed corpus
library(polmineR)
@giodamelio
giodamelio / outline-bookmarklet.js
Last active April 4, 2022 13:01
A bookmarklet to process the current page to Outline.com and redirect afterwards.
fetch(
"https://outlineapi.com/v3/parse_article?source_url=" +
encodeURIComponent(window.location)
)
.then(res => res.json())
.then(body => {
if (body.error) {
return alert(`Outline Bookmarklet Error: ${body.error}`);
}
window.location.href = `https://outline.com/${body.data.short_code}`
@PolMine
PolMine / sentiws.R
Last active May 30, 2022 12:37
Import SentiWS dictionary for sentiment analysis into R as data.table
# The get_sentiws function will download the zip-file with the SentiWS dictionary,
# unzip it and return a data.table.
library(data.table)
get_sentiws <- function(){
sentiws_tmp_dir <- file.path(tempdir(), "sentiws")
if (!file.exists(sentiws_tmp_dir)) dir.create(sentiws_tmp_dir)
sentiws_zipfile <- file.path(sentiws_tmp_dir, "SentiWS_v1.8c.zip")
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active June 25, 2024 19:32
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@meirbon
meirbon / Dell XPS 15 9560 Manjaro Setup instructions
Last active May 13, 2024 02:39
Small, quick guide to set up Manjaro on the XPS 15 9560
# 1. First of all of course get Manjaro:
https://manjaro.org/get-manjaro/
# I recommend using Etcher to copy the image to your USB:
https://etcher.io/
# 2. Before installing make sure:
# - Secure boot is disabled in BIOS
# - Your SSD, HDD or NVME drive is set to AHCI instead of RAID
# - Fastboot should be on Auto or minimal, but this shouldn't matter to much
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active June 26, 2024 05:15
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@jee-r
jee-r / nginx
Created October 30, 2016 22:06
emby nginx proxypass
# See: https://emby.media/community/index.php?/topic/22889-emby-behind-a-reverse-proxy-remote-control-issue/
server {
server_name mydomain;
listen 80;
rewrite ^ https://mydomain$request_uri? permanent;
}
server {
@Christian-G
Christian-G / docx2md.sh
Last active June 28, 2023 11:35 — forked from jesperronn/docx2md.md
Convert Word documents into Markdown
#!/bin/bash
#
# generate a Markdown version of a word document. Goes in separate folder, since
# images are extracted and converted as well (separate folder avoids naming clashes).
#
# REQUIREMENTS: pandoc
#
#
# with pandoc
# --extract-media=[media folder]