Skip to content

Instantly share code, notes, and snippets.

View daluu's full-sized avatar

David Luu daluu

View GitHub Profile
@tvvignesh
tvvignesh / .gitlab-ci.yml
Created December 22, 2019 17:46
Example on running Skaffold with GITLAB CI for Kubernetes in GKE (Make sure you modify it appropriately and set GCP_SERVICE_KEY and GCP_PROD_SERVICE_KEY variable in Gitlab with the service account json value)
services:
- docker:dind
stages:
- development
- production
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ''
@2minchul
2minchul / main.go
Created December 4, 2019 05:06
Cancellation for http request using NewRequestWithContext in Golang
package main
import (
"context"
"net/http"
"time"
)
func main() {
ctx := context.Background()
@jerblack
jerblack / tee.go
Last active May 7, 2025 20:18
Golang: Mirror all writes to stdout and stderr in program to log file
package main
import (
"fmt"
"io"
"log"
"os"
)
func main() {
@braandl
braandl / detect-ipados.js
Last active July 21, 2023 07:50
Detect iPad OS (v 13) with Javascript
var isIPadOs = window.AuthenticatorAssertionResponse === undefined
&& window.AuthenticatorAttestationResponse === undefined
&& window.AuthenticatorResponse === undefined
&& window.Credential === undefined
&& window.CredentialsContainer === undefined
&& window.DeviceMotionEvent !== undefined
&& window.DeviceOrientationEvent !== undefined
&& navigator.maxTouchPoints === 5
&& navigator.plugins.length === 0
&& navigator.platform !== "iPhone";
@darkobits
darkobits / repl.groovy
Last active September 15, 2022 12:20
Jenkins Interactive Shell
script {
while (true) {
def cmd = input(message: 'Jenkins Interactive Shell', parameters: [
string(name: 'cmd', description: 'Enter a command or leave blank to continue job.', defaultValue: '')
], ok: 'Execute')
if (cmd == '') { print 'Continuing job...'; break; }
try { sh cmd } catch (err) { }
}
}
@jrichardsz
jrichardsz / open jdk implementations.md
Created October 5, 2019 16:23
Other JDK implementations, open jdk , java free versions
@ws2356
ws2356 / uninstall_mac_app
Created September 5, 2019 05:25
bash script used to uninstall mac osx app and related config file
#!/usr/bin/env bash
set -e
app_name=$1
dry_run=${2:-false}
declare -a locations=(
/Applications
~/Library/Application\ Support
~/Library/Preferences
@pocc
pocc / parse_pcap_parts.py
Created August 9, 2019 22:05
This script will print the header, packet headers, packets, and the footer for any format.
"""This script will print the header, packet headers, packets, and the footer for any format."""
import subprocess as sp
import re
import os
def create_pcap():
if not os.path.exists("temp.pcapng"):
sp.call(["tshark", "-w", "temp.pcapng", "-c", "3"])
return "temp.pcapng"
#!/usr/bin/env python
"""Wrapper tool for writing aws credentials into profiles."""
import argparse
import configparser
import platform
import subprocess
from os import path
from shutil import which
parser = argparse.ArgumentParser(description='Wrapper script for aws-okta tool.')
@estorgio
estorgio / Mounting VirtualBox shared folders on Ubuntu Server 18.04 LTS (Bionic Beaver).md
Last active March 10, 2025 19:33
Mounting VirtualBox shared folders on Ubuntu Server 18.04 LTS (Bionic Beaver)

Mounting VirtualBox shared folders on Ubuntu Server 18.04 LTS (Bionic Beaver)

This guide will walk you through the steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest.

Prerequisites

This guide assumes that you are using the following setup:

You could still make this guide work with other setups (possibly with some modifications to the commands and whatnot).