This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./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...] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################### | |
# 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env rdmd | |
/* | |
Author : Ky-Anh Huynh | |
License : MIT | |
Purpose : A bug in std.getopt | |
Date : 2018 07 29 | |
Description: | |
$ dmd --version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto foo(string[] sta) { | |
return sta; | |
} | |
auto bar(string[] sta) { | |
return sta; | |
} | |
auto h(string[] sta) { | |
return sta.foo.bar; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% 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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |