Skip to content

Instantly share code, notes, and snippets.

View cab404's full-sized avatar
💜
s p a r k l i n g u n i c o r n p r i n c e s s ™

Cabia Rangris cab404

💜
s p a r k l i n g u n i c o r n p r i n c e s s ™
View GitHub Profile

Keybase proof

I hereby claim:

  • I am cab404 on github.
  • I am cab404 (https://keybase.io/cab404) on keybase.
  • I have a public key ASDj-0nuqHxzRNhSUeBhlMO-NzBIGsgdr4LJnIfcQ-AS1Ao

To claim this, I am signing this object:

@cab404
cab404 / vecs.kt
Last active September 27, 2018 17:25
Simple 2D utilities for Kotlin
import kotlin.math.*
data class Vec2(
val x: Float,
val y: Float
) {
constructor() : this(0f, 0f)
constructor(x: Number, y: Number) : this(x.toFloat(), y.toFloat())
companion object {
@cab404
cab404 / buckethit.py
Last active April 30, 2018 12:13
Image resizer for Android based on PIL
#!/usr/bin/python3
# @author cab404
# Thing that resizes images for android
import os
import argparse
import random
from multiprocessing import Pool
from PIL import Image
@cab404
cab404 / 9patch-resize.sh
Last active March 29, 2018 20:33
Resizer for 9patch images based on im utils
#!/bin/bash
# resizer for android 9patch icons
# getting center part
convert -shave 1 $1 core.png
# getting sides
convert -gravity West -crop 1x+0+0 $1 l.png
convert -gravity East -crop 1x+0+0 $1 r.png
convert -gravity South -crop x1+0+0 $1 b.png
@cab404
cab404 / interesting-macs
Created March 13, 2018 21:26
Just some interesting macs, filtered from MT_FREE
00:0A:F5:66:C2:A4
04:B1:67:B5:87:F1
28:ED:6A:87:D4:A6
38:F2:3E:8F:69:20
58:48:22:45:6B:FC
80:EA:96:4A:02:C4
8C:8E:F2:7C:FD:90
98:00:C6:33:B3:66
B0:E5:ED:9A:8B:9F
D8:5B:2A:B1:1E:A3
diff --git a/dellfan.c b/dellfan.c
index 5f9098d..1f71236 100644
--- a/dellfan.c
+++ b/dellfan.c
@@ -67,10 +67,10 @@
* putting the speed to maximum, sleeping some seconds, and checking the speed back.
* Check the function probecodes()
*/
-#define DISABLE_BIOS_METHOD1 0x30a3
-#define ENABLE_BIOS_METHOD1 0x31a3
@cab404
cab404 / checkmacs.sh
Last active April 3, 2018 07:05
MAC address checker for moscow metro
#!/bin/bash
# script for finding userdata from a list of macs.
# for educational purposes only, of course.
INPUT=$1
SSID=MT_FREE
DEV=${2:-wlp1s0}
OUTDIR=check-`date +%d-%m-%yT%H:%M:%S`
function jsonf() { python -c 'import json; json.dump(json.load(open("/dev/stdin", "r")), open("/dev/stdout", "w"), indent=2)'; echo; }
#!/bin/bash
id=$(xinput list --id-only "SynPS/2 Synaptics TouchPad")
is_on=$(xinput list-props $id | grep "Device Enabled" | tail -c 2 | grep 1)
echo $is_on
if (( $is_on ))
then
state=0;
@cab404
cab404 / cache
Created February 1, 2018 16:23
caching script for drone.io Volume Cache
#!/bin/bash
# drone.io cache simplifier by cab404, for using with Volume Cache plugin
# allows you to cache practically anything from anywhere, specifying only '.drone-cache' in mounts
# to pack something do "cache in (smthn)"
# to unpack all do "cache out"
#
# e.g you want to cache /root/.gradle/cache and /root/.gradle/wrapper (typical for android), you do
# get-cache:
# image: drillster/drone-volume-cache
# restore: true
package ru.todaydelivery.android
import android.bluetooth.BluetoothAdapter
import android.bluetooth.BluetoothDevice
import android.bluetooth.BluetoothSocket
import ru.todaydelivery.android.Printer3CottBT.PRINTER_UUID
import java.io.Closeable
import java.io.OutputStream
import java.nio.charset.Charset
import java.util.*