Skip to content

Instantly share code, notes, and snippets.

View bitkill's full-sized avatar
🍉

Rui Fernandes bitkill

🍉
View GitHub Profile
<?php
class ConfigController {
const MODEL = 'App\Models\Config';
// see RestControllerTrait. sends less data on indexing the list of the model
// protected $indexFields = [ 'name' ];
protected $triggers = [
// 'show' => 'extendObject',
// 'update' => 'dataFormatFix',
@bitkill
bitkill / pom.xml
Created January 31, 2020 12:09
Jacoco Coverage Override
<!-- TODO: REMOVE -->
<properties>
<jacoco.line.coveredratio>0.60</jacoco.line.coveredratio>
<jacoco.branch.coveredratio>0.60</jacoco.branch.coveredratio>
</properties>
@bitkill
bitkill / classFinder.sh
Created February 4, 2020 14:40
Jar class collision finder
#!/bin/bash
if [ $# == 0 ]; then
dir='.'
elif [ $# == 1 ]; then
dir=$1
else
echo "Usage: $0 [dir]";
exit 1;
fi
@bitkill
bitkill / scripts.md
Last active April 1, 2020 11:13
Linux webcam scripts

Preferred settings (no AF, pre-set focus to a good distance, up contrast by a bit)

v4l2-ctl -d /dev/video4 --set-ctrl=focus_absolute=35 --set-ctrl=contrast=132 --set-ctrl=focus_auto=0

Blur Hide Yourself

v4l2-ctl -d /dev/video4 --set-ctrl=focus_absolute=255
@bitkill
bitkill / readme.md
Created May 27, 2020 18:59
[CentOS Admin]

CentOS Administration

Get all packages that need to be installed in order to have x package

repoquery --requires --resolve --recursive <package>

You can remove recursive to see direct matches

Similar command, but in relation to the current system

@bitkill
bitkill / readme.md
Created June 19, 2020 14:09
Gnome boxes ubuntu
sudo apt install virt-manager
sudo systemctl enable libvirtd
sudo systemctl enable virtlogd
sudo systemctl start libvirtd
sudo systemctl start virtlogd
sudo adduser `id -un` kvm
@bitkill
bitkill / wait-for-postgres.sh
Last active July 29, 2020 15:02
Wait for a service via tcp
#!/usr/bin/env bash
RETRIES=10
while !</dev/tcp/postgres/5432 & [ $RETRIES -eq 0 ]; do
echo "Waiting for postgres server, $((RETRIES--)) remaining attempts...";
sleep 1;
done;
@bitkill
bitkill / .block
Last active August 10, 2020 14:35
D3.js Histogram II
license: mit