Skip to content

Instantly share code, notes, and snippets.

View benoahriz's full-sized avatar
:octocat:
makin stuff

Benjamin Rizkowsky benoahriz

:octocat:
makin stuff
View GitHub Profile
# QEmu
brew install qemu
# Home for out tests
mkdir ~/arm-emu
cd ~/arm-emu
# Download initrd and kernel
wget http://ftp.de.debian.org/debian/dists/jessie/main/installer-armel/current/images/versatile/netboot/initrd.gz
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active June 17, 2024 15:05
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@henriquemenezes
henriquemenezes / curl-upload-file.sh
Last active September 12, 2023 20:19
Using CURL to Upload Files
# curl - Raw upload
curl -X PUT -T image.png https://example.com/upload
# curl - Content-Type: multipart/form-data
curl -F name=logo -F file=@image.png https://example.org/upload
# curl - POST presigned URL (S3)
@9to5IT
9to5IT / PS_Script_Template_V2_NoLogs.ps1
Last active May 1, 2024 19:20
PowerShell: Script Template Version 2 (without logging)
#requires -version 4
<#
.SYNOPSIS
<Overview of script>
.DESCRIPTION
<Brief description of script>
.PARAMETER <Parameter_Name>
<Brief description of parameter input required. Repeat this attribute if required>
@benoahriz
benoahriz / .gitignore
Last active August 29, 2015 14:27 — forked from karmi/.gitignore
Example Nginx configurations for Elasticsearch
nginx/
!nginx/.gitkeep
!nginx/logs/.gitkeep
src/
tmp/
@tjheeta
tjheeta / chef_inventory.py
Created February 15, 2015 04:16
Chef dynamic inventory for Ansible
#!/usr/bin/env python
from __future__ import print_function
import argparse
import json
import chef
import os
import sys
import re
from time import time
@tonymtz
tonymtz / gist:d75101d9bdf764c890ef
Last active May 7, 2024 13:07
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
#!/bin/bash -x
if [[ $UID != 0 ]]; then
echo "Please run this script with with a root shell i.e. sudo su -"
echo "sudo $0 $*"
exit 1
fi
#Manual Cleanup
echo "Manual cleanup Items"
rm /var/cache/apt/*.bin
@jameskyle
jameskyle / certs.sh
Last active June 7, 2017 18:46
Generating CA, Server, & Client Certificates
#!/bin/bash
###############################################################################
# NOTICE: This script is intended to be used in conjunction with a openssl.cnf
# template such as this one:
# https://gist.github.com/jameskyle/8106d4d5c6dfa5395cef
# (C) Copyright 2014 James A. Kyle.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ekristen
ekristen / check_docker_container.sh
Last active July 15, 2024 09:29
Bash Script for Nagios to Check Status of Docker Container
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# Depending on your docker configuration, root might be required. If your nrpe user has rights
# to talk to the docker daemon, then root is not required. This is why root privileges are not