Skip to content

Instantly share code, notes, and snippets.

@phnahes
phnahes / gist:8e8b8132e6693344b5cf383c9b8467df
Created August 28, 2020 15:36
Decrypt Jenkins credential.xml
println(hudson.util.Secret.decrypt("{...}"))
@phnahes
phnahes / settings.json
Created July 17, 2020 20:15
Windows Terminal Settings
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
"copyOnSelect": true,
"copyFormatting": false,
"profiles":
{
"defaults":
{
@phnahes
phnahes / wsl.conf
Created July 17, 2020 20:14
Windows Subsystem Linux - /etc/wsl.conf
[automount]
enabled = true
root = /
options = "metadata,umask=22,fmask=11,uid=1000,gid=1000"
mountFsTab = false
[network]
generateHosts = true
generateResolvConf = true
source <(grep -v '^#' .env | sed -E 's|^(.+)=(.*)$|: ${\1=\2}; export \1|g')
@phnahes
phnahes / insert_on_line.sh
Created June 1, 2020 00:42
Add script on specific line using bash
awk 'NR==3{print "insert your text here"}1' /etc/config.ini
@phnahes
phnahes / DenyWithoutMFAPresent.json
Last active June 1, 2020 00:43
Deny Aws login Without MFA Present
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"*"
],
"Resource": [
"*"
],
@phnahes
phnahes / SwitchRole.md
Last active May 27, 2020 18:15
How use SwitchRole in Two or more AWS Accounts

AWS Switch Role

Scenario:

  • Source account ID: 123456789 ** Devops Group.

  • Destination account ID: 999999999

How to

@phnahes
phnahes / rpi.gpio
Created April 25, 2020 01:37
Install GPIO packages for RaspberryPi
sudo apt-get update
sudo apt-get install build-essential python-dev python-pip python-setuptools -y
export ARCH=arm
export CROSS_COMPILE=/usr/bin/
pip install rpi.gpio
@phnahes
phnahes / config.txt
Created April 23, 2020 13:10
Configurations for config.txt on RaspberryPi
# Configure HDMI to work on low resolutions for bad monitors
# https://www.raspberrypi.org/documentation/configuration/config-txt/video.md - Session hdmi_mode
hdmi_force_hotplug=1
hdmi_ignore_edid=0xa5000080
config_hdmi_boost=4
hdmi_group=2
hdmi_mode=4
disable_overscan=0
overscan_left=24
@phnahes
phnahes / bcd.bat
Created April 17, 2020 21:45
Clone HDD to SSD and using SSD for Boot and System (UEFI)
# Boot a LiveCD linux and install clonezilla
apt update && apt install clonezilla -y
# Using Gparted, clone partitions in the same type, size and flags from source disk (sda) on target target(sdb)
# After, using clonezilla, clone part_to_part
# sda1 to sdb1
# sda2 to sdb2
# sda3 to sdb3
#