Skip to content

Instantly share code, notes, and snippets.

View hayzem's full-sized avatar

Ali hayzem

  • Istanbul
View GitHub Profile
@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
@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 / 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 / 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 / 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 / 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 / docker-mysql-dump-and-restore.sh
Created April 20, 2018 12:32
docker mysql container dump and restore
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@hayzem
hayzem / redis-migrate.sh
Created February 27, 2018 11:45 — forked from nicStuff/redis-migrate.sh
Comfort tool for migrating redis keys among instances. Supports KEYS syntax matching, authentication and TTL
#!/bin/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 / materialize_form_theme.html.twig
Created October 17, 2017 19:15 — forked from JusteLeblanc/materialize_form_theme.html.twig
Symfony2 form theme to integrate Materialize in your Symfony2 forms
{% extends 'form_div_layout.html.twig' %}
{% block form_row -%}
<div class="row{% if (not compound or force_error|default(false)) and not valid %} has-error{% endif %}">
<div class="input-field col s12">
{{- form_widget(form) -}}
{{- form_label(form) -}}
{{- form_errors(form) -}}
</div>
</div>
@hayzem
hayzem / mysql_5.7_modes.sql
Created October 13, 2017 07:46
MySQL 5.7 Modes
SET GLOBAL sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';