Skip to content

Instantly share code, notes, and snippets.

Avatar

Marcin Kulik sickill

View GitHub Profile
@craSH
craSH / bulletproof_arch.md
Last active Jul 30, 2022 — forked from altercation/bulletproof_arch.txt
Bulletproof Arch - Minimal Clean Install
View bulletproof_arch.md

Bulletproof Arch

These are working notes on the installation of Arch Linux. I've just completed this install on a notebook (@altercation: Lenovo P50. @craSH: Dell XPS 13" 9380) but the setup should work for most laptop/desktop configurations.

Some assumptions/notes:

  1. This isn't a dual boot configuration. I can see some of the appeal and still work in Adobe from time to time, but given the increasing complexity of EFI and the way Windows/MS manhandles the EFI partition during upgrades, I really would recommend steering clear of dual boot. Just my two cents here.
@m-radzikowski
m-radzikowski / script-template.sh
Last active Aug 10, 2022
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
View script-template.sh
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
View proxmox_resize_pve-root
# Check disk space before
df -h
# Delete local-lvm storage in gui
lvremove /dev/pve/data
lvresize -l +100%FREE /dev/pve/root
resize2fs /dev/mapper/pve-root
View renaming.clj
;; Step 1) Produce a build with :advanced optimizations. Tell me the size of the .js file.
;; Step 2) Run `gzip` on your output .js file and tell me the size of the .js.gz file.
;; Step 3) Apply this monkey patch:
(in-ns 'cljs.closure)
(import '[com.google.javascript.jscomp VariableRenamingPolicy PropertyRenamingPolicy])
(def wrapped-set-options set-options)
(defn set-options [opts ^CompilerOptions compiler-options]
@jstepien
jstepien / reduce-and-gc.clj
Last active Mar 6, 2017
reduce-and-gc.clj
View reduce-and-gc.clj
;; Let's experiment with Clojure 1.8.0 running with a relatively small heap
;; of 10MB. To avoid any extra dependencies, we'll start it as follows:
;;
;; java -Xmx10m -jar clojure-1.8.0.jar
;;
;; Copy following expressions into your REPL one by one.
;;
;; Let's take a small number, for instance one million.
(def small-num (* 1000 1000))
@mjnaderi
mjnaderi / install-arch.md
Last active Jul 15, 2022 — forked from mattiaslundberg/arch-linux-install
Install Arch Linux with Full Disk Encryption (LVM on LUKS)
View install-arch.md
@oinopion
oinopion / read-access.sql
Created Oct 5, 2016
How to create read only user in PostgreSQL
View read-access.sql
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@brianleroux
brianleroux / wtf-sns-apns.js
Created Aug 5, 2016
Send a silent push notification to APNS with AWS SNS.
View wtf-sns-apns.js
sns.publish({
TargetArn: device.arn,
MessageStructure: 'json',
Message: JSON.stringify({
default: 'you will never see this muah!',
APNS_SANDBOX: JSON.stringify({
aps: {
'alert': '',
'content-available': 1
},
@bastman
bastman / docker-cleanup-resources.md
Created Mar 31, 2016
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@jamonholmgren
jamonholmgren / plug.conn.ex
Created Mar 9, 2016
Typical Elixir Phoenix Plug.Conn struct contents, in an easy-to-read format. By Jamon Holmgren.
View plug.conn.ex
%Plug.Conn{
adapter: {Plug.Adapters.Cowboy.Conn, :...},
assigns: %{
my_assigns: "here"
},
before_send: [
#Function<7.125546534/1 in Phoenix.Controller.fetch_flash/2>,
#Function<1.127904613/1 in Plug.Session.before_send/2>,
#Function<1.43511252/1 in Plug.Logger.call/2>,
#Function<0.70322810/1 in Phoenix.LiveReloader.before_send_inject_reloader/1>