Skip to content

Instantly share code, notes, and snippets.

View icy's full-sized avatar
🦖
Available

Ky-Anh Huynh icy

🦖
Available
View GitHub Profile
@icy
icy / challenge6.sh
Last active June 6, 2018 13:52
challenge6.sh
#!/usr/bin/env bash
# Purpose : Grant/Revoke SSH access
# Author : Ky-Anh Huynh
# License : MIT
# Date : 2018-May-20
_err() {
echo >&2 ":: $(date -u): ERR: ${FUNCNAME[1]:-$0}: $*"
return 1
@icy
icy / challenge6_screenshots.sh
Last active June 6, 2018 13:53
challenge6_screenshots.sh
$ ./challenge6.sh
:: Sun May 20 04:29:20 UTC 2018: ERR: main: Please try -h or --help for details
$ ./challenge6.sh -h
challenge6.sh -- Grant or Revoke ssh user on Linux servers
Syntax:
challenge6.sh username host1 [host2...]
challenge6.sh +username host1 [host2...]
@icy
icy / salt_cloud_test_pr_48199.sh
Last active June 19, 2018 13:22
salt_cloud_test_pr_48199.sh
$ cat /etc/salt/cloud.profiles.d/test-dev.conf
test-dev:
image: ami-8fcc75ec
provider: aws-dev-default
size: t2.micro
ssh_username: ubuntu
subnetid: subnet-ba6a47de
securitygroupid:
- sg-24449f42
ssh_gateway: ssh-gateway.example.net
@icy
icy / ssalt_cloud_test_pr_48048.sh
Created June 19, 2018 11:54
ssalt_cloud_test_pr_48048.sh
$ cat /etc/salt//cloud.providers.d/aws-dev.conf
aws-dev-default:
minion:
master: saltmaster.example.net
id: 'foo'
key: 'm+bar'
role_arn: 'arn:aws:iam::02415096xxxx:role/DeveloperCrossAccountAccessRole'
ssh_interface: private_ips
private_key: /root/.ssh/id_rsa
keyname: salt_testing
@icy
icy / Dockerfile.demo-proxy.sh
Created June 28, 2018 07:56
Dockerfile.demo-proxy.sh
###############################################################
# Dockerfile generated by Bocker-v1.3. Do not edit this file. #
###############################################################
FROM ubuntu:16.04
MAINTAINER Anh K. Huynh <[email protected]>
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Here is from `__ed_before_ship` method. You may need your own
# custom one to advance the base image when it doesn't have Bash.
@icy
icy / std.getopt.problem.d
Created July 29, 2018 09:25
std.getopt.problem.d
#!/usr/bin/env rdmd
/*
Author : Ky-Anh Huynh
License : MIT
Purpose : A bug in std.getopt
Date : 2018 07 29
Description:
$ dmd --version
auto foo(string[] sta) {
return sta;
}
auto bar(string[] sta) {
return sta;
}
auto h(string[] sta) {
return sta.foo.bar;
@icy
icy / Ngo-Thuy-Mien-Ban-Tinh-Cuoi.ly
Last active August 27, 2018 02:19
Ngo-Thuy-Mien-Ban-Tinh-Cuoi.ly
% The latest version is available at https://github.com/icy/muzik
% Bài hát: Bản tình cuối
% Sáng tác: Ngô Thụy Miên
% Lilypond: Huỳnh Kỳ Anh, 2014.08.02
% Giấy phép: CC BY-SA 3.0
\version "2.18.2"
\score {
@icy
icy / jenkins_script_print_last_builds_for_all_jobs.groovy
Created August 6, 2018 04:08
jenkins_script_print_last_builds_for_all_jobs.groovy
// Author : Ky-Anh Huynh
// License: MIT
// Origin : https://gist.github.com/dnozay/e7afcf7a7dd8f73a4e05#file-disk-usage-retention-groovy
jobs = Jenkins.instance.getAllItems()
jobs.each { j ->
if (j instanceof com.cloudbees.hudson.plugins.folder.Folder) { return }
if (j instanceof jenkins.branch.OrganizationFolder) { return }
if (j instanceof org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject) { return }
@icy
icy / bluetooth_all.sh
Created August 6, 2018 04:17
bluetooth_all.sh
#!/usr/bin/env bash
# Purpose : Fuck your bluetooth device and make them red
# Author : woh
sudo killall pulseaudio
sudo killall pulseaudio
pulseaudio -D
sudo rfkill unblock all
sudo systemctl restart bluetooth