Skip to content

Instantly share code, notes, and snippets.

@myyc
myyc / arch_linux_install_guide.md
Last active April 13, 2025 03:01
Arch Linux setup with all the good stuff (Plymouth, encryption, systemd-boot etc.)

I've used this guide through 2024 despite archinstall and it's still more or less valid. After having used archinstall twice and having encountered obscure issues (luksOpen taking ages, or slow reboots in general) I switched back to a manual setup and it seems to be almost as straightforward.

Always refer to the official guide in case of doubt.

First things first

One important thing first: the environment you will encounter on the live image is very different from what you'll end up installing, some things are significantly easier there: e.g. wifi tools come

@RasmusFonseca
RasmusFonseca / multiproducer-consumer.py
Last active September 30, 2024 07:17
Python multiple producer / single consumer example
from multiprocessing import Process, Queue
def square_producer(inputqueue, resultqueue):
"""
A producer that pops numbers off the inputqueue, squares them and puts the result on resultqueue
"""
while True:
num = inputqueue.get()
if num is None:
@dlight
dlight / minha_coisinha.el
Last active February 12, 2018 02:50
coisinha q eu fiz pra mudar de buffer
(defun keys (a)
(when a
(global-set-key (read-kbd-macro (nth 0 a)) (nth 1 a))
(keys (cddr a))))
(keys '("<s-left>" my-previous-buffer
"<s-right>" my-next-buffer
"<s-up>" next-regular-buffer
"<s-down>" previous-star-buffer))
anonymous
anonymous / playground.rs
Created January 21, 2018 16:54
Rust code shared from the playground
trait AsRecord {
fn as_record(&self) -> String;
}
#[derive(Debug)]
struct MyRecord(u32);
impl AsRecord for MyRecord {
fn as_record(&self) -> String {
format!("hey, I've got {}", self.0)
}
#[allow(unused_imports)]
#[macro_use]
extern crate lazy_static;
#[cfg(test)]
mod tests {
use std::sync::{Mutex, MutexGuard, Once, ONCE_INIT};
/// Substitua String pelo tipo da sua conexão.
lazy_static! {
extern crate rocket;
use rocket::{Request, Data, Outcome};
use rocket::data::{self, FromData};
use rocket::Outcome::*;
use std::collections::HashMap;
pub struct WhereStructResult {
sql: String, values: Vec<String>,
@igr-santos
igr-santos / catarse.rst
Last active May 6, 2016 16:59
Documento tem como objetivo montar a campanha para crowdfunding

Campanha Python Sudeste 2016

Esse documento tem como objetivo montar a campanha para organizarmos as finanças e recompensas do evento Python Sudeste 2016, no modelo de crowdfunding, utilizando a ferramenta do Catarse

TODO

! `xev` and `showkey` to see which keycode is pressed
!old keys
!xmodmap -pke |grep Something
!keycode 50 = Shift_L ISO_Prev_Group Shift_L ISO_Prev_Group
!keycode 62 = Shift_R ISO_Next_Group Shift_R ISO_Next_Group
!keycode 66 = Caps_Lock NoSymbol Caps_Lock
!keycode 22 = BackSpace BackSpace BackSpace BackSpace NoSymbol NoSymbol Terminate_Server
!keycode 37 = Control_L NoSymbol Control_L
@maxclaus
maxclaus / alias-docker-compose.sh
Last active August 27, 2023 15:11
Aliases for docker-compose
alias c='docker-compose'
alias cb='docker-compose build'
alias cup='docker-compose up'
alias cr='docker-compose run --service-ports --rm'
alias crl='docker-compose run --service-ports --rm local'
alias crd='docker-compose run --service-ports --rm develop'
alias crt='docker-compose run --rm test'
alias crp='docker-compose run --rm provision'
alias crci='docker-compose run --rm ci'
alias crwt='docker-compose run --rm watchtest'