Skip to content

Instantly share code, notes, and snippets.

View Madh93's full-sized avatar
🏠
Work from home

Miguel Hernández Madh93

🏠
Work from home
View GitHub Profile
@ayoubzulfiqar
ayoubzulfiqar / folder_structure.md
Created September 5, 2023 06:12
The Folder Structure for Every Golang Project

Go - The Ultimate Folder Structure

Organizing your Go (Golang) project's folder structure can help improve code readability, maintainability, and scalability. While there is no one-size-fits-all structure, here's a common folder structure for a Go project:

project-root/
    ├── cmd/
    │   ├── your-app-name/
    │   │   ├── main.go         # Application entry point
    │   │   └── ...             # Other application-specific files
@vladwa
vladwa / gcpComputeInstanceDetails.py
Last active July 21, 2020 07:56
Python code snippet to fetch the compute instance details by connecting to Google API Client using Python client library for Google's discovery.
#vars
# SERVICE_ACCOUNT_FILE --> Service Account Json file
# project --> Gcp Project Name
# zone --> zone in which instance is created
# instance_name --> Instance name
from google.oauth2 import service_account
from googleapiclient import discovery
SCOPES = ["https://www.googleapis.com/auth/cloud-platform"]
@afloesch
afloesch / jenkins-in-docker.md
Last active April 23, 2024 11:15
Jenkins in Docker (docker-in-docker)

Jenkins in Docker (docker-in-docker)

Testing Jenkins flows on your local machine, or running Jenkins in production in a docker container can be a little tricky with a docker-in-docker scenario. You could install Jenkins to avoid any docker-in-docker issues, but then you have Jenkins on your machine, and the local environment is likely going to be a fairly different from the actual production build servers, which can lead to annoying and time-consuming issues to debug.

Build environment differences are precisely why there is a strong argument to be made to run build processes strictly in docker containers. If we follow the philosophy that every build step or action should run in a docker container, even the Jenkins server itself, then we get massive benefits from things like, total control over the build environment, easily modify the build environment without the possibility of adversely effecting other jobs, explicit and strongly controlled tool versions,

@parthdesai93
parthdesai93 / aws_es_connector.js
Last active April 8, 2021 06:18
http-aws-es compatible with new Elasticsearch client.
/* requires AWS creds to be updated.
* if they aren't, update using AWS.config.update() method before instatiing the client.
*
* import this module where you instantiate the client, and simply pass this module as the connection class.
*
* eg:
* const client = new Client({
* node,
* Connection: AwsConnector
* });
@thielemans
thielemans / ffmpeg-audioconvert
Last active June 19, 2022 13:38
Add a 5.1 DTS or AC3 audio stream from a 7.1 DTS-HD stream using ffmpeg to allow directplay
#Downconvert 7.1 DTS-HD to DTS 5.1:
ffmpeg -i in.mkv -strict -2 -map 0:a:0 -c dts -af "channelmap=channel_layout=5.1" dts.mkv
#Downconvert 7.1 DTS-HD to AC3 5.1:
ffmpeg -i in.mkv -map 0:a:0 -c ac3 -ac 6 -ab 640k ac3.mkv
#Add downconverted audio streams via ffmpeg:
ffmpeg -i in.mkv -i dts.mkv -i ac3.mkv -map 0:v -c:v copy -map 0:a -c:a copy -map 1:a -c:a copy -map 2:a -c:a copy -map 0:s -c:s copy out.mkv
#Or use MKVToolNix
  1. ownload mojave installer -> app store
  2. formatting usb: diskutil partitionDisk /dev/disk1 2 MBR FAT32 "CLOVER EFI" 200Mi HFS+J "install_osx" R

install https://bitbucket.org/RehabMan/clover/downloads/Clover_v2.4k_r4701.RM-4963.ca6cca7c.zip to CLOVER Partition

For Clover UEFI, run the Clover Installer package:

  • if using MBR, select the target of the install to "CLOVER EFI" using "Change Install Location"
  • select "Customize" (the default is a legacy install -- we need to change it)
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 2, 2024 06:57
set -e, -u, -o, -x pipefail explanation
@GAS85
GAS85 / nextcloud_fail2ban.md
Last active April 8, 2024 20:51
Harden Nextcloud 17+ with Fail2Ban, GUI and WebDAV - Ubuntu 20.04

Fail2ban and Nextcloud

Prerequsits

  • Ubuntu 20.04
  • nextcloud, fail2ban and e.g. iptables are installed

Note

@pastleo
pastleo / nm_l2tp_ipsec_vpn.md
Last active March 20, 2024 19:42
setup L2TP IPSEC VPN in archlinux using NetworkManager
@enoliglesias
enoliglesias / config.ru
Last active April 19, 2017 17:56
Some examples for my "Rack basics" slides :)
class Wadus
def call(env)
['200', {'X-Wadus' => 'Foo'}, ['Rack app with config.ru file']]
end
end
run Wadus.new