Skip to content

Instantly share code, notes, and snippets.

View dawitnida's full-sized avatar

Dawit Nida dawitnida

View GitHub Profile
@dawitnida
dawitnida / redis_cheatsheet.bash
Created September 17, 2018 09:06 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@dawitnida
dawitnida / LC_CTYPE.txt
Created July 25, 2018 12:23 — forked from thanksdanny/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@dawitnida
dawitnida / get-aws-ecr-repositories.sh
Last active July 24, 2018 10:56 — forked from rpherrera/get-aws-ecr-repositories-names.sh
get aws ecr repositories names with aws cli, parsing results with jq and stripping double quotes with sed or tr
#!/bin/bash
# stripping double quotes with sed
aws ecr describe-repositories | jq '.repositories[].repositoryName' | sed s/\"//g
# stripping double quotes with tr
aws ecr describe-repositories | jq '.repositories[].repositoryName' | tr -d '"'
# stripping double quotes with 'r' option
aws ecr describe-repositories | jq -r '.repositories[].repositoryArn'
@dawitnida
dawitnida / upsource-aws-setup.md
Created July 11, 2018 09:49 — forked from grocky/upsource-aws-setup.md
Setting up Jebrains Upsource on AWS

Installing and configuring Upsource on AWS with SSL

Upsource is a tool that brings Jetbrains IDE's code insights to code reviews. Upsource's integration with Jetbrains IDEs and GitHub are some of the most attractive features for us at VideoBlocks since we're heavy users of them both. We currently have over 50 private repos and use IntelliJ, PHPStorm and WebStorm to build our core products. All of our infrastructure is hosted on AWS now, so I decided to get this up and running there for quick evaluation.

Launch an EC2 Instance

This step is straight forward and there are already some good resources for setting up an EC2 instance. I won't go into detail here, but I chose an Ubuntu AMI at a size of M3.large (which is the minimum instance size Jetbrains recommends). We're configuring our security group with the standard HTTP ports (80 and 443) and exposing the standard SSH port 22.

@dawitnida
dawitnida / slack.php
Created July 2, 2018 12:08 — forked from stefanzweifel/slack.php
Slack.com Webhook Integration (PHP) - Simple snippet which tells you, how to build your payload array.
<?php
//Options
$token = 'YOUR_TOKEN_HERE';
$domain = 'YOUR_SLACK_DOMAIN_GOES_HERE';
$channel = '#general';
$bot_name = 'Webhook';
$icon = ':alien:';
$message = 'Your message';
#!/bin/bash
cd /tmp
file=$(date +%a).sql
mysqldump \
--host ${MYSQL_HOST} \
--port ${MYSQL_PORT} \
-u ${MYSQL_USER} \
--password="${MYSQL_PASS}" \
${MYSQL_DB} > ${file}
if [ "${?}" -eq 0 ]; then