Skip to content

Instantly share code, notes, and snippets.

View depau's full-sized avatar

Davide Depau depau

View GitHub Profile
@eiselekd
eiselekd / enableDCI.txt
Last active April 18, 2024 12:22
Enable DCI debugging on Gigabyte-BKi5HA-7200
Enable DCI debugging on Gigabyte-BKi5HA-7200
--------------------------------------------
The Gigabyte-BKi5HA-7200 (Kabylake i5-7200 processor) can be debugged with only a USB debug cable, a
special cable that crosses only the data signals and has the power signals
removed. You can buy these cables at i.e. https://www.datapro.net/products/usb-3-0-super-speed-a-a-debugging-cable.html
The hurdle you have to overcome before you can access DCI however is that you
need to set some bits in hardware that first enable DCI and also enable the debug port so that DCI can control the cores.
There are lots of guides in howto patch the BIOS but only these two really describes all the steps using only freely accessible tools:
@awave1
awave1 / Blur.java
Created May 6, 2016 17:54
Blur drawable or bitmap on android using renderscript
public static class Blur {
private static final float BLUR_RADIUS = 20.5f; // 25 is maximum radius
// returns blur drawable if api >= 17. returns original drawable if not.
@Nullable
public static Drawable applyBlur(Drawable drawable, Context context) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
Bitmap fromDrawable = drawableToBitmap(drawable);
int width = Math.round(fromDrawable.getWidth() * 0.8f);
@jonsuh
jonsuh / .bash_profile
Last active February 16, 2024 17:17
Bash echo in color
# ----------------------------------
# Colors
# ----------------------------------
NOCOLOR='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
@stefanschmidt
stefanschmidt / remove-annotations.sh
Last active February 1, 2024 17:01
Remove all annotations from a PDF document
pdftk original.pdf output uncompressed.pdf uncompress
LANG=C sed -n '/^\/Annots/!p' uncompressed.pdf > stripped.pdf
pdftk stripped.pdf output final.pdf compress