Skip to content

Instantly share code, notes, and snippets.

@phackwer
phackwer / README-convert-properties-to-json-using-jq.md
Created Aug 23, 2022 — forked from drmalex07/README-convert-properties-to-json-using-jq.md
Convert properties to JSON using jq. #properties $json #jq
View README-convert-properties-to-json-using-jq.md

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

View Making Apple Developer certificates on Linux
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 / touchpad-fix
Created Dec 5, 2021 — forked from v-dimitrov/touchpad-fix
touchpad fn key fix
View touchpad-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)
View gist:58693f002acf67c1fd0c5a85e8470c36
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:
View Virtual box in Ubuntu (for that cases when you need a Winbox)
In Ubuntu 16.04 LTS, after the initial install with
sudo apt install virtualbox virtualbox-guest-additions-iso virtualbox-ext-pack
I also had to:
sudo usermod -a -G vboxusers $USER
Then I could enable USB 2/3 support in the machine settings.
View gist:863246d4f05f1aa86786b59106a943fc
sudo gedit /etc/systemd/system/rc-local.service
Then add the following content to it.
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local start
@phackwer
phackwer / gist:5207d76b189794d68fe37401d046b742
Last active Feb 13, 2020
Scroll on non-scrollwheel devices
View gist:5207d76b189794d68fe37401d046b742
Just install mouseemu by:
sudo apt-get install mouseemu
and edit "/etc/default/mouseemu" and add the line:
SCROLL="-scroll 56"
126 is the key scan code for the right super key. you can find other key codes by using showkey in the terminal. now restart mouseemu:
View gist:07d3da53aa33231ed4905c62d0dbee67
gsettings set org.gnome.settings-daemon.peripherals.mouse locate-pointer true
@phackwer
phackwer / gist:ef2819332f9c5a1d7572c7ada1e68b89
Last active Nov 29, 2021
SonarQube on Docker and local scanner
View gist:ef2819332f9c5a1d7572c7ada1e68b89
# 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 \
View gist:1517484769a4330c9ffc9b8e1e24d1fc
Get a list of branches
for remote in `git branch -r `; do git branch --track $remote; done
Remove merged remote branches
git branch --merged master | grep -v master | cut -d/ -f2- | xargs -n 1 git push --delete origin
Remove merged local branches