Skip to content

Instantly share code, notes, and snippets.

View hayzem's full-sized avatar

Ali hayzem

  • Istanbul
View GitHub Profile
@hayzem
hayzem / redis-migrate.sh
Created July 19, 2018 14:44
Bash script for redis key migration
#!/usr/bin/env bash
######
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
# TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
######
@hayzem
hayzem / gh-deploy-clone.sh
Created August 20, 2019 10:04 — forked from blvz/gh-deploy-clone.sh
Creates a deploy key and clones the repository.
#!/usr/bin/env bash
read -r -d '' usage << EOM
Usage:
gh-deploy-clone user/repo [ENVIRONMENT]
EOM
[ -z "$1" ] && echo && echo "$usage" && echo && exit 1
@hayzem
hayzem / Has weird right-to-left characters.txt
Created August 23, 2019 11:52 — forked from endolith/Has weird right-to-left characters.txt
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@hayzem
hayzem / Jenkinsfile
Created September 3, 2019 17:39 — forked from bvis/Jenkinsfile
Jenkin pipeline definition example to be integrated with Docker Swarm cluster in our CI/CD environment
pipeline {
agent { node { label 'swarm-ci' } }
environment {
TEST_PREFIX = "test-IMAGE"
TEST_IMAGE = "${env.TEST_PREFIX}:${env.BUILD_NUMBER}"
TEST_CONTAINER = "${env.TEST_PREFIX}-${env.BUILD_NUMBER}"
REGISTRY_ADDRESS = "my.registry.address.com"
SLACK_CHANNEL = "#deployment-notifications"
@hayzem
hayzem / remove-circle-ci-repos.sh
Created September 10, 2019 21:25
remove circleci repos
#ref: https://discuss.circleci.com/t/remove-projects-we-accidentally-added/27766/2
TOKEN="x"
ORG="MyOrgName"
URL_SUFFIX="/enable?circle-token="$TOKEN
URL_PREFIX="https://circleci.com/api/v1.1/project/github/"$ORG"/"
while IFS='' read -r repo || [[ -n "$repo" ]]; do
sleep 2
curl -X "DELETE" $URL_PREFIX$repo$URL_SUFFIX
@hayzem
hayzem / docker-image-modify-and-tag.sh
Created October 4, 2019 21:18
modify content of docker image and tag
docker run -it --name "{containerName}" --entrypoint "/bin/bash" {imageName}
// modify your container here
// --entrypoint modifys image entrypoint. if it is defined to something else in the image you have yo change it back
docker run -it --name "{containerNameWithOriginalEP}" --entrypoint "{originalEntrypoint}" {containerName}
// now {containerNameWithOriginalEP} can be tagged and pushed