Skip to content

Instantly share code, notes, and snippets.

View azenla's full-sized avatar
🏳️‍⚧️
cabbit mode

Alex Zenla azenla

🏳️‍⚧️
cabbit mode
View GitHub Profile
@Siguza
Siguza / pallas.sh
Last active August 13, 2024 08:20
newstyle OTA
#!/usr/bin/env zsh
set -e;
set +m; # Job control would've been nice, but manual round robin it is, sigh.
if [ -z "${ZSH_VERSION+x}" ]; then
echo 'Try again with zsh.';
exit 1;
fi;
@insidegui
insidegui / gist:a18124c0c573a4eb656f5c485ea7dae4
Last active September 25, 2024 19:37
Unofficial documentation for the iCloud Apple device image URL format
https://statici.icloud.com/fmipmobile/deviceImages-9.0/iPhone/iPhone9,4-2-3-0/online-infobox__3x.png
A B C D E F G
A: deviceImages version seems to determine the format of the image specifier (C, D, E, F)
B: device marketing name
C: device model identifier
D: color cover glass (front color)
1 - Black
2 - White
E: device enclosure color (back color)
@gabrieljcs
gabrieljcs / lvm-cache-fedora.md
Last active July 14, 2024 11:47
Instructions to create an LVM cache for root in Fedora

LVM cache in Fedora

From the man-pages: "The cache logical volume type uses a small and fast LV to improve the performance of a large and slow LV. It does this by storing the frequently used blocks on the faster LV. LVM refers to the small fast LV as a cache pool LV. The large slow LV is called the origin LV. Due to requirements from dm-cache (the kernel driver), LVM further splits the cache pool LV into two devices - the cache data LV and cache metadata LV. The cache data LV is where copies of data blocks are kept from the origin LV to increase speed. The cache metadata LV holds the accounting information that specifies where data blocks are stored (e.g. on the origin LV or on the cache data LV). Users should be familiar with these LVs if they wish to create the best and most robust cached logical volumes. All of these associated LVs must be in the same VG."

Assuming LVM is already setup in HDD (e.g. from anaconda) and SSD is untouched.

Create a physical

@azenla
azenla / systemctl.dart
Last active June 1, 2022 18:22
systemctl API in Dart
import "dart:io";
class SystemCTL {
static const String CIRCLE = "\u25CF";
final bool useSudo;
SystemCTL({this.useSudo: false});
Future<bool> start(String service) async {
part of dartboard;
class FutureGroup {
Completer _completer = new Completer();
List<Future> _futures = <Future>[];
FutureGroup();
bool add(Future future) {
if(!_futures.contains(future)) {
@azenla
azenla / dart-dev-git.md
Last active August 29, 2015 14:02
Dart Language Development with Git (for Dart Language/VM Developers)
@azenla
azenla / testly-build.litcoffee
Last active August 29, 2015 14:02
Testly Build File - Uses CoffeeScript and ShellJS

Build Script

This Build Script is completely written in Literate CoffeeScript with ShellJS's Make System

--version target

Adds support for the make --version flag

target "--version", ->
    # Print Version Information
    echo "testly v#{pkginfo.version} make script (shelljs v#{pkginfo["dependencies"].shelljs.substr(1)})"
@granoeste
granoeste / webkitmediasource-is-type-supported.html
Last active December 26, 2021 10:54
[JavaScript][HTML5][MediaSource] MediaSource.isTypeSupported
<!DOCTYPE html>
<html>
<head>
<script>
window.MediaSource = window.MediaSource || window.WebKitMediaSource;
function testTypes(types) {
for (var i = 0; i < types.length; ++i)
console.log("MediaSource.isTypeSupported(" + types[i] + ") : " + MediaSource.isTypeSupported(types[i]));
}
@azenla
azenla / GroovyFeatureRequests.md
Last active August 29, 2015 13:55
Groovy Feature Requests

Syntax

  • Anonymous Blocks
  • Native support

Utilities

@sma
sma / lua.dart
Last active December 16, 2015 20:39
A parser and simple runtime system for a Lua interpreter written in Dart. Have fun with it! Should work with Dart M4.
// Copyright 2013 Stefan Matthias Aust. Licensed under MIT (http://opensource.org/licenses/MIT)
import 'dart:math' show pow;
/*
* This is a parser and runtime system for Lua 5.x which lacks most if not all of the Lua standard library.
* I created the parser a couple of years ago and now ported it to Dart just to see how difficult it would be.
*/
void main() {