Skip to content

Instantly share code, notes, and snippets.

View alicankustemur's full-sized avatar
🐳
Extracting [=======> ] 93.00MB/100MB

Ali Can Kuştemur alicankustemur

🐳
Extracting [=======> ] 93.00MB/100MB
View GitHub Profile
@ikbear
ikbear / idle.sh
Last active April 18, 2021 10:00
Docker image entrypoint idle script
#!/bin/bash
echo "This is a idle script (infinite loop) to keep container running."
echo "Please replace this script."
cleanup ()
{
kill -s SIGTERM $!
exit 0
}
@aespinosa
aespinosa / job.groovy
Last active September 2, 2021 13:55
create a jenkins job in the script console
import jenkins.model.Jenkins;
import hudson.model.FreeStyleProject;
import hudson.tasks.Shell;
job = Jenkins.instance.createProject(FreeStyleProject, 'job-name')
job.buildersList.add(new Shell('echo hello world'))
job.save()
@KenDUemura
KenDUemura / gist:48856cc1e9cd1aedf041b602ce89bf15
Created September 29, 2016 23:31
Jenkins Pipeline, Get current Job's Folder Name
def getFolderName() {
def array = pwd().split("/")
return array[array.length - 2];
}
node(){
stage 'Get Folder Name'
def foldername = getFolderName()
print "${foldername}"
@eunomie
eunomie / README.md
Created April 27, 2017 09:44
How to send containers log to ELK using gelf log driver

Send docker logs to ELK through gelf log driver

There's so many way to send logs to an elk... logspout, filebeat, journalbeat, etc.

But docker has a gelf log driver and logstash a gelf input. So here we are.

Here is a docker-compose to test a full elk with a container sending logs via gelf.

@james2doyle
james2doyle / getXML.go
Last active July 28, 2024 06:00
Use HTTP to GET and parse XML in golang
// tweaked from: https://stackoverflow.com/a/42718113/1170664
func getXML(url string) ([]byte, error) {
resp, err := http.Get(url)
if err != nil {
return []byte{}, fmt.Errorf("GET error: %v", err)
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return []byte{}, fmt.Errorf("Status error: %v", resp.StatusCode)
@vedit
vedit / awspr
Last active September 11, 2021 08:45
AWS Profile Selector
#!/bin/bash
export AWS_PROFILE=$(zenity --list $(cat ~/.aws/config | grep profile | sed 's/profile //g' | sed 's/\[//g' | sed 's/\]//g' | sort) --column="" --text="Select a Profile" --title="AWS Profile Selection")
echo "${AWS_PROFILE}"
# Call the script with either "source awspr" or ". awspr" after placing the script in your path and making it executable
# Or add an alias by adding the following line to your .bashrc
# alias awsp=". awspr"