Skip to content

Instantly share code, notes, and snippets.

View leventyalcin's full-sized avatar
💭
Available to hire

Levent Yalcin leventyalcin

💭
Available to hire
View GitHub Profile
@leventyalcin
leventyalcin / archiva notes
Last active December 16, 2015 21:50
Archive notes
Init Script;
#!/bin/bash
#
#Script to start/stop/status/restart archiva
# chkconfig: 35 20 80
# description: Apache Archiva
ARCHIVA_PATH=/opt/apache-archiva-1.3.6/bin
@leventyalcin
leventyalcin / gist:5619203
Created May 21, 2013 11:36
If chef doesn't have yum group install you can do your own group install generator. lolz! (yum-utils should be installed)
repoquery -g -l --grouppkgs=default,mandatory 'base'| sort | while read n; do echo "yum_package" "\"$n."$(yum info $n | grep -e "^Arch" | sort | tail -n1 | awk -F: '{gsub(/[[:space:]]*/,"",$2); print $2}')"\""; done
@leventyalcin
leventyalcin / memcached.conf
Last active December 19, 2015 02:29
If you wanna run multiple version of memcached on CentOS you can use this /etc/sysconfig/memcached and /etc/init.d/memcached files and wanna understand what differences it has with defaults you can look at diff first and last revision
# /etc/sysconfig/memcached
PORT="11211 11212"
USER="memcached"
MAXCONN="1024"
CACHESIZE="512"
OPTIONS="-l 127.0.0.1"
# /etc/init.d/memcached
#! /bin/sh
@leventyalcin
leventyalcin / redis.
Created June 28, 2013 11:35
Running multiple instance of Redis on Centos. For understanding how add new instance look at first comment and if you want to what changed on init script with default you can check first and last revision of file.
#!/bin/sh
#
# redis init file for starting up the redis daemon
#
# chkconfig: - 20 80
# description: Starts and stops the redis daemon.
# Source function library.
. /etc/rc.d/init.d/functions
@leventyalcin
leventyalcin / authorized_keys
Last active October 27, 2015 10:16
SSH public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDD3D+XP+Zrms6+G1Ap9l1qF8Kr5fX6f66eBb58Te1d3KJpGPG2AfxZyRR3HAHAqhA7kSTRwYEiL3/OvclUcWu4ztKXzPRXUGyBKoNCIzoh+0hOKh2c14adv9bERgoppnL3761d/NOIJIQJNDG9LFFvddXR8nlR3WNmBJOrH6naYo8QA56gLzp4MnKaPMMXgvBQ1BjPM2kV8BeSV4Fq62zVl3Rsckca0TSiIyOLjhaA6+XSRhVF99R1AItCG4PMZRboGb+ci17jEWlxzQ5099nySwlisgTANc9SlpBlwLmkiZefqi/SZLlhqg1RlJ2qpY27UVGAztzore5sA6ab3svv leoman@Levents-MacBook-Pro.local
@leventyalcin
leventyalcin / byobu-install.md
Last active August 29, 2015 14:02
there is couple of error to installing byobu by macports and this is how i installed

Installing byobu by macports;

$ mkdir -p /tmp/ports/devel/byobu
$ cd /tmp/ports/devel/byobu/
$ curl -o Portfile 'https://trac.macports.org/raw-attachment/ticket/30238/Portfile'

Add the line below to /opt/local/etc/macports/sources.conf (before the rsync:// line) file:///tmp/ports

@leventyalcin
leventyalcin / onliner.sh
Last active October 14, 2016 18:37
Recover deleted files on Amazon S3
aws --output=text --profile=PROFILE s3api list-object-versions --bucket BUCKET_NAME --region=REGION --prefix=DIRNAME \
| grep -e "DELETEMARKERS\tTrue" \
| while read LINE \
do \
KEY=`echo $LINE | awk '{print $3}'` VERSION=`echo $LINE | awk '{print $NF}'` \
aws --profile=PROFILE s3api delete-object --bucket BUCKET_NAME --key $KEY --version-id $VERSION --region=REGION \
done
#!/bin/bash
USER='root'
PASS='demoserver'
HOST='localhost'
BACKUPDIR='/backup'
IGNOREDBS='information_schema performance_schema'
RETENTION=14
@leventyalcin
leventyalcin / vardump.j2
Created October 19, 2015 01:12
Ansible var dump template
Module Variables ("vars"):
--------------------------------
{{ vars | to_nice_json }}
Environment Variables ("environment"):
--------------------------------
{{ environment | to_nice_json }}
GROUP NAMES Variables ("group_names"):
--------------------------------
#!/bin/bash
tshark -l -2 -R \
'(dns.qry.name == "DOMAINNAME.COM" or dns.qry.name == "SUB.DOMAIN.COM") and dns.response_to' \
-T fields \
-e frame.time \
-e dns.time \
-e dns.qry.name \
-e dns.resp.addr \
>> ALL_DNS_RESULTS