Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@phackwer
phackwer / RectangleConfig.json
Created November 17, 2023 16:54
My rectangle setup to get Windows like window+moves shortcuts
{
"bundleId" : "com.knollsoft.Rectangle",
"defaults" : {
"allowAnyShortcut" : {
"bool" : false
},
"almostMaximizeHeight" : {
"float" : 0
},
"almostMaximizeWidth" : {
@phackwer
phackwer / City Model
Created June 7, 2017 17:59
Laravel 5 - all cities, regions, states and countries from Gazeteer
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class City extends Model
{
/**
* @var array
@phackwer
phackwer / README-convert-properties-to-json-using-jq.md
Created August 23, 2022 09:37 — forked from drmalex07/README-convert-properties-to-json-using-jq.md
Convert properties to JSON using jq. #properties $json #jq

README

Say we have a properties file at foo.properties.

First, clean-up whitespace and empty lines, store in foo-1.properties:

cat foo.properties | \
    sed 's/[[:space:]]*=[[:space:]]*/=/' | \
    sed 's/[[:space:]]*$//' | \

sed '/^$/d' > foo-1.properties

1. Create a new directory;
mkdir Apple\ Enterprise
cd Apple\ Enterprise
2. Generate a certificate signing request
openssl req -nodes -newkey rsa:2048 -keyout ios_enterprise.key -out CertificateSigningRequest.certSigningRequest
Note: If you want to password-protect the .pem key, ditch the -nodes switch on step 2:
openssl req -newkey rsa:2048 -keyout ios_enterprise.key -out CertificateSigningRequest.certSigningRequest
@phackwer
phackwer / gist:da1439517be54a4257e9db6f2b3243c8
Last active February 25, 2022 15:28
downgrade firmware macbook air
https://support.apple.com/en-ie/HT201860
https://apple.stackexchange.com/questions/103720/how-to-downgrade-efi-firmware-back-to-version-1-6
I finally managed to successfully downgrade the EFI firmware to version 1.6. Unfortunately that didn't make my hard drive work. However I'm going to reproduce my steps here so that the whole world can know what it takes:
Download the EFI firmware update package from Apple. Here is the link I used for firmware version 1.6 for my late-2008 MacbookPro5,1: http://support.apple.com/kb/DL746
WARNING! If you use the wrong firmware for you computer, bad things will almost certainly happen. This isn't my experience but it would probably brick your computer, meaning it will change from being a computer that can compute things to being a brick that just sits there. You have been warned!
The EFI firmware update 1.6 comes as a .pkg file. Since it won't extract for you unless your computer needs the update, you will have to extract it yourself. The best way I found
@phackwer
phackwer / touchpad-fix
Created December 5, 2021 01:12 — forked from v-dimitrov/touchpad-fix
touchpad fn key fix
#!/bin/sh
# toggle touch pad
device=`xinput list --name-only | grep -i touchpad`
isOn=`xinput list-props "$device" | grep -i enabled | tail -c 2`
iconEnabled='input-touchpad-symbolic'
iconDisabled='touchpad-disabled-symbolic'
case "$isOn" in
0)
@phackwer
phackwer / gist:ef2819332f9c5a1d7572c7ada1e68b89
Last active November 29, 2021 15:44
SonarQube on Docker and local scanner
# SONAR QUBE SERVER RUN
docker run -d --rm \
-p 9000:9000 \
-p 9092:9092 \
-v sonarqube_conf:/opt/sonarqube/conf \
-v sonarqube_extensions:/opt/sonarqube/extensions \
-v sonarqube_logs:/opt/sonarqube/logs \
-v sonarqube_data:/opt/sonarqube/data \
--name sonarqube \
@phackwer
phackwer / gist:5b5628aff011eb853639d35613b625ce
Last active June 4, 2021 08:52
Remove purple from Ubuntu 16.04
Remove grub background color:
16.04 and later:
sudo -H gedit /usr/share/plymouth/themes/ubuntu-logo/ubuntu-logo.grub
17.10 and later:
sudo -H gedit /usr/share/plymouth/themes/default.grub
@phackwer
phackwer / gist:9f9db7bc95396a48b240f5c3a42cf944
Last active August 17, 2020 13:09
Undervolting linux ubuntu 18.04 (XPS 9570 i9 32GB RAM)
Very useful for the i9 XPS 9570 overheating on Linux. Since I use Linux for development, I don't use the nvidia that comes
with the note and also don't need turboboost enabled, even running dozens of docker containers. I was having problems with
temperature. Notebook was getting so hot it was hard to type for more than 4 hours straight.
Here are my temperatures before undevolting:
phackwer@phackwer-XPS-15-9570 ~/P/p/poc> sensors
coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +53.0°C (high = +100.0°C, crit = +100.0°C)
Get the required packages before trying to install it:
apt-get install build-essential
apt-get install dkms
apt-get install linux-generic
apt-get install linux-signed-generic
Download driver at https://www.displaylink.com/downloads/file?id=1304, unzip it, chmod 777 and install as root
Now, to make sure it will not fail: