Skip to content

Instantly share code, notes, and snippets.

View palerdot's full-sized avatar
💭
.

Arun Kumar palerdot

💭
.
View GitHub Profile
- name: Overprovision like the pros'
hosts: all
tasks:
- name: Install early OOM killer and zram
ansible.builtin.apt:
pkg:
- earlyoom
- zram-tools
- name: Configure early OOM killer
ansible.builtin.lineinfile:
local wezterm = require "wezterm"
local config = wezterm.config_builder()
local action = wezterm.action
config.set_environment_variables = {
PATH = '/opt/homebrew/bin:' .. os.getenv('PATH')
}
local function scheme_for_appearance(appearance)
if appearance:find "Dark" then
//! A zig builder step that runs "libtool" against a list of libraries
//! in order to create a single combined static library.
const LibtoolStep = @This();
const std = @import("std");
const Step = std.build.Step;
const RunStep = std.build.RunStep;
const FileSource = std.build.FileSource;
pub const Options = struct {
@shakna-israel
shakna-israel / LetsDestroyC.md
Created January 30, 2020 03:50
Let's Destroy C

Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?


@silmeth
silmeth / rust_serde_base64_bytes.rs
Created May 16, 2019 18:49
Serialization and deserialization byte array (Vec<u8>) to/from json in Rust as Base64 string using Serde
use serde::{Deserialize, Deserializer, Serialize, Serializer};
#[derive(Serialize, Deserialize, Debug)]
pub struct Foo {
#[serde(serialize_with = "as_base64", deserialize_with = "from_base64")]
bytes: Vec<u8>,
}
fn as_base64<T: AsRef<[u8]>, S: Serializer>(val: &T, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(&base64::encode(val))
use std::collections::HashMap;
use std::fmt;
use std::io;
use std::num::ParseFloatError;
use std::rc::Rc;
/*
Types
*/
@mrx06
mrx06 / uninstall paragon ntfs 15 full
Created September 3, 2018 17:17
full uninstall paragon ntfs 15 (reset trial)
sudo rm -rf "/Library/Application Support/Paragon Software/"
sudo rm /Library/LaunchDaemons/com.paragon-software.installer.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfs.loader.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfsd.plist
sudo rm /Library/LaunchAgents/com.paragon-software.ntfs.notification-agent.plist
sudo rm -rf /Library/Filesystems/ufsd_NTFS.fs/
sudo rm -rf /Library/PrivilegedHelperTools/com.paragon-software.installer
sudo rm -rf /Library/Extensions/ufsd_NTFS.kext/
sudo rm -rf /Library/PreferencePanes/ParagonNTFS.prefPane
@zioproto
zioproto / redis-delete-old-keys.py
Last active March 3, 2023 18:45
Delete Redis Stale Keys
#!/usr/bin/env python
import redis
r = redis.StrictRedis(host='localhost', port=6379, db=0)
# To debug code on a single key you can use this instead of the for loops:
# key = r.randomkey()
# Delete all keys not accessed since 'idletime'
for key in r.scan_iter("*"):
idle = r.object("idletime", key)
@swalkinshaw
swalkinshaw / tutorial.md
Last active October 24, 2025 14:52
Designing a GraphQL API
@mrothNET
mrothNET / LetsEncrypt+certbot+UFW+postfix+dovecot.md
Last active March 31, 2025 09:54
Let's Encrypt / Dovecot / Postfix / UFW firewall / Certbot

Let's Encrypt / Dovecot / Postfix / UFW firewall / Certbot

This tutorial describes how to install TLS to a mail server consisting of Postfix and/or Dovecot by using Let's Encrypt certificates with automatic renewing and firewall management.

The system used for this tutorial was:

$ lsb_release -idrc
Distributor ID: Ubuntu