Skip to content

Instantly share code, notes, and snippets.

@Chenx221
Chenx221 / recovery.json, cloudready_recovery.json
Last active October 30, 2023 17:55
Chrome OS recovery images manual download (Flex)
# Chrome OS recovery images manual download
https://dl.google.com/dl/edgedl/chromeos/recovery/recovery2.json
https://dl.google.com/dl/edgedl/chromeos/recovery/recovery.json
# Google Chrome OS Flex images manual download
https://dl.google.com/dl/edgedl/chromeos/recovery/cloudready_recovery2.json
https://dl.google.com/dl/edgedl/chromeos/recovery/cloudready_recovery.json
@sorki
sorki / callNode2nix.nix
Created January 8, 2021 13:35
callNode2nix.nix
{ pkgs ? import <nixpkgs> {}, ... }:
# experiment based on https://github.com/MatrixAI/TypeScript-Demo-Lib/pull/13
# needs `--option sandbox false` so not used for now
with pkgs;
let
callNode2nix = name: src: { nodeVersion ? builtins.elemAt (lib.versions.splitVersion nodejs.version) 0 }:
let
@bureado
bureado / packaging-resources.md
Created June 21, 2018 00:04
Post-modern Linux packaging: additional reading

Post-modern Linux packaging: additional reading

Summary

This document compiles 2018 coverage around post-modern packaging technologies for Linux, including packaging formats like Snaps and Flatpaks, systems like Nix and Guix and full distros such as Atomic or Clear Linux.

This curation and commentary are current as of 18 June 2018. The curation was prepared by José Miguel Parrella (@bureado) as part of his session at Open Source Summit Japan: Package Management and Distribution in a Cloud World.

We compile these resources in an effort to provide individual developers and organizations with current coverage on the state-of-the-art and motivations of the current post-modern packaging landscape with the intention to increase readiness in experimenting with, evaluating and potentially adopting said technologies.

@vancluever
vancluever / gnome-tracker-disable.md
Last active May 2, 2024 16:26
GNOME Tracker Disable

Disabling GNOME Tracker and Other Info

GNOME's tracker is a CPU and privacy hog. There's a pretty good case as to why it's neither useful nor necessary here: http://lduros.net/posts/tracker-sucks-thanks-tracker/

After discovering it chowing 2 cores, I decided to go about disabling it.

Directories

@jrudolph
jrudolph / TestMultipartFileUpload.scala
Last active February 13, 2023 18:09
akka-http Multipart file-upload client + server example
package akka.http.scaladsl
import java.io.File
import akka.http.scaladsl.unmarshalling.Unmarshal
import akka.util.ByteString
import scala.concurrent.duration._
import akka.actor.ActorSystem
@sylr
sylr / postgres-9.5-sharding.sh
Last active June 11, 2019 21:23
Postgresql 9.5 sharding example
echo master shard_{0,1,2,3} | xargs -n1 /usr/local/bin/dropdb -p 6432 -h /tmp -U postgres
echo master shard_{0,1,2,3} | xargs -n1 /usr/local/bin/createdb -p 6432 -h /tmp -U postgres
for a in {0..3}; do
echo "
CREATE TABLE users (id serial PRIMARY KEY, username TEXT NOT NULL);
ALTER SEQUENCE users_id_seq INCREMENT BY 4 RESTART WITH $a;
" | /usr/local/bin/psql -p 6432 -h /tmp -U postgres -d shard_$a;
done
@mkaminsky11
mkaminsky11 / wl_monitor.sh
Last active December 1, 2023 17:59
Enables monitor mode for wl driver(Broadcom)
#!/bin/sh
# so, by default, monitoring and injection cannot be used with Broadcom wl wifi drivers (such as those for Macs)
# this makes it impossible to do stuff like crack wifi passwords with aircrack-ng
# fortunately, there is a solution burried in https://www.broadcom.com/docs/linux_sta/README.txt
echo 1 > /proc/brcm_monitor0 #enables monitor mode. That's it!
# prism0 is now like "mon0" (monitor mode)
@lolzballs
lolzballs / HelloWorld.java
Created March 22, 2015 00:21
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();
@shekibobo
shekibobo / README.md
Last active March 2, 2020 11:04
Android: Base Styles for Button (not provided by AppCompat)

How to create custom button styles using Android's AppCompat-v7:21

Introduction

AppCompat is an Android support library to provide backwards-compatible functionality for Material design patterns. It currently comes bundled with a set of styles in the Theme.AppCompat and Widget.AppCompat namespaces. However, there is a critical component missing which I would have thought essential to provide the a default from which we could inherit our styles: Widget.AppCompat.Button. Sure, there's Widget.AppCompat.Light.ActionButton, but that doesn't actually inherit from Widget.ActionButton, which does not inherit from Widget.Button, so we might get some unexpected behavior using that as our base button style, mainly because Widget.ActionButton strictly belongs in the ActionBar.

So, if we want to have a decently normal default button style related to AppCompat, we need to make it ourselves. Let's start by digging into the Android SDK to see how it's doing default styles.

Digging In

@dsugden
dsugden / upickleakkahttp.scala
Last active August 29, 2015 14:12
upickle akka-http
import akka.http.marshalling._
import akka.http.model._
import akka.http.unmarshalling.{FromResponseUnmarshaller, FromRequestUnmarshaller, Unmarshaller}
import akka.stream.FlowMaterializer
import upickle.{Writer, Reader}
import scala.concurrent.duration._
import scala.concurrent.{ExecutionContext, Future}
import scala.language.implicitConversions