- Channel synchronization
- Timeout
- Non-blocking channel operation
- Timer
- Ticker
- Worker pool
- Rate limiting
- Automic counter
- Stateful goroutine
- Collection function
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
import java.io.*; | |
import java.util.Enumeration; | |
import java.util.zip.ZipEntry; | |
import java.util.zip.ZipFile; | |
import java.util.zip.ZipOutputStream; | |
public class ZipUtility { | |
private final File zipFilePath; |
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/env/python | |
from __future__ import print_function | |
import socket | |
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) | |
s.bind(('0.0.0.0',2121)) | |
s.listen(1) | |
print('XXE-FTP listening ') | |
conn,addr = s.accept() | |
print('Connected by %s',addr) |
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
#!/bin/bash | |
# Deletes branches that have been removed on origin | |
function no_remote() { | |
if git rev-parse --git-dir >/dev/null 2>&1; then | |
git fetch --prune | |
echo "Branches with no remote:" | |
git branch -vv | cut -c 3- | awk '$3 !~/\[/ { printf " %s\n", $1 }' | |
echo -e "\nDeleting branches with deleted remote:" | |
del=$(git branch -vv | awk '$4 ~/gone\]/ { printf "git branch -D %s && ", $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
#!/bin/bash | |
# Stop all containers | |
containers=`docker ps -a -q` | |
if [ -n "$containers" ] ; then | |
docker stop $containers | |
fi | |
# Delete all containers | |
containers=`docker ps -a -q` | |
if [ -n "$containers" ]; then | |
docker rm -f -v $containers |
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
## update machine | |
sudo apt-get update | |
## Install essentials and basic utility | |
sudo apt install -y \ | |
build-essential libssl-dev zlib1g-dev libbz2-dev \ | |
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \ | |
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl git | |
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
#!/bin/sh | |
#################################################################### | |
# Check for Homebrew, install if we don't have it | |
#################################################################### | |
if test ! $(which brew); then | |
echo "Installing homebrew..." | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
fi |
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
############################# Filebeat ###################################### | |
filebeat: | |
prospectors: | |
- | |
paths: | |
- /var/log/<APP>/app.log | |
fields: | |
logzio_codec: plain | |
token: ${token} | |
application: app # Custom field and value (can be filtered in logz.io) |
#Sharing Session
Muhammad Zaky Alvan ([email protected])
BDD is extension of TDD, which write test failing test first, then implement system and/or components under tests, make the tests passes and iterate.
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
// | |
// DocuSign API Quickstart - Embedded Signing | |
// | |
import java.io.IOException; | |
import java.io.File; | |
import java.net.MalformedURLException; | |
import java.util.Arrays; | |
import java.util.List; |