Skip to content

Instantly share code, notes, and snippets.

View Ev3rlasting's full-sized avatar
💭
I may be slow to respond.

Ray P Ev3rlasting

💭
I may be slow to respond.
  • Singapore
View GitHub Profile
@Ev3rlasting
Ev3rlasting / kill.sh
Created September 7, 2018 10:46
kill.sh
#!/bin/sh
ps aux | grep redis-sentinel | awk '{ print $2}' | sudo xargs kill -9
psaux_result=$(ps aux | grep redis-sentinel | wc -l)
#echo $psaux_result
if [ $psaux_result -ge 2 ];
then
exit 1
else
exit 0
@Ev3rlasting
Ev3rlasting / check_query_on_all_tables.py
Created April 10, 2018 10:41
check_query_on_all_tables.py
import csv
cqlFileName = "queries.cql"
f=open(cqlFileName, "w")
with open ('system_schema.tables.csv') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
f.write("SELECT COUNT(*) as "+ row['keyspace_name'] + "__" + row['table_name'] + " FROM " + row['keyspace_name'] + "." + row['table_name'] + " LIMIT 1000;\n");
@Ev3rlasting
Ev3rlasting / Startup Script for Ubuntu.sh
Last active March 19, 2024 08:50
Starup Script for Ubuntu
#! /bin/bash
# create bash profile and alias
mkdir -p ~/github/
BASH_ALIAS="alias gs='git status' gl='git log' gp='git pull' gd='git diff' mci='mvn clean install' mecee='mvn eclipse:clean eclipse:eclipse' github='cd ~/github/'"
echo $BASH_ALIAS >> ~/.bash_aliases
source ~/.bash_aliases
alias cb='cargo build' cl='cargo clippy'
alias k='kubectl'
@Ev3rlasting
Ev3rlasting / logback.xml
Last active February 26, 2018 10:38
LogBack XML configuration Example
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
<Target>System.out</Target>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n</pattern>
</encoder>
</appender>
<root level="Error">
<appender-ref ref="stdout"/>
@Ev3rlasting
Ev3rlasting / mongo_backup.sh
Created October 14, 2016 23:30 — forked from sheharyarn/mongo_backup.sh
Mongodump Shell Script for Cronjob
#!/bin/bash
MONGO_DATABASE="your_db_name"
APP_NAME="your_app_name"
MONGO_HOST="127.0.0.1"
MONGO_PORT="27017"
TIMESTAMP=`date +%F-%H%M`
MONGODUMP_PATH="/usr/bin/mongodump"
BACKUPS_DIR="/home/username/backups/$APP_NAME"