Skip to content

Instantly share code, notes, and snippets.

View ntedgi's full-sized avatar
:bowtie:
sudo init 6

Naor Tedgi (Abu Emma) ntedgi

:bowtie:
sudo init 6
View GitHub Profile
@ntedgi
ntedgi / postgres_queries_and_commands.sql
Last active July 2, 2018 11:53 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@ntedgi
ntedgi / anaconda-tensorflow-keras.txt
Created July 4, 2018 11:01 — forked from jeffgreenca/anaconda-tensorflow-keras.txt
Anaconda Keras / TensorFlow environment setup
Install TensorFlow (CPU), Keras, and some other tools to a new anaconda environment.
Open Anaconda Prompt
conda create --name tensorflow35 python=3.5
conda activate tensorflow35
conda install jupyter
conda install scipy
conda install spyder
pip install tensorflow
@ntedgi
ntedgi / Common Docker Commands
Created February 24, 2019 07:06
Common Docker Commands
docker run <image name> <command>
If image not exist we pull it
Docker run = create + run
The command is override and execute inside the container
* docker image ps
Display all running containers
* docker image ps - - all
Show all running docker ever
@ntedgi
ntedgi / id_rsa_encryption.md
Created March 9, 2019 11:25
Encrypt/Decrypt a File using your SSH Public/Private Key on Mac OS X

A Guide to Encrypting Files with Mac OS X

This guide will demonstrate the steps required to encrypt and decrypt files using OpenSSL on Mac OS X. The working assumption is that by demonstrating how to encrypt a file with your own public key, you'll also be able to encrypt a file you plan to send to somebody else using their private key, though you may wish to use this approach to keep archived data safe from prying eyes.

Too Long, Didn't Read

Assuming you've already done the setup described later in this document, that id_rsa.pub.pcks8 is the public key you want to use, that id_rsa is the private key the recipient will use, and secret.txt is the data you want to transmit…

Encrypting

$ openssl rand 192 -out key

$ openssl aes-256-cbc -in secret.txt -out secret.txt.enc -pass file:key

@ntedgi
ntedgi / migrate_repo.sh
Created September 23, 2019 09:24 — forked from mariozig/migrate_repo.sh
Migrate repo from GitLab to GitHub Full blog post @ http://ruby.zigzo.com/2015/03/23/moving-from-gitlab-to-github/
# Assume we are in your home directory
cd ~/
# Clone the repo from GitLab using the `--mirror` option
$ git clone --mirror git@your-gitlab-site.com:mario/my-repo.git
# Change into newly created repo directory
$ cd ~/my-repo.git
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks.
@ntedgi
ntedgi / My_ZSH_Alias.txt
Last active April 7, 2020 11:40
my zsh alias scripts
# Internet Speed Test
alias speedtest="curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -"
# Docker
alias docker_clean_images='docker rmi $(docker images -a --filter=dangling=true -q)'
alias docker_clean_ps='docker rm $(docker ps --filter=status=exited --filter=status=created -q)'
@ntedgi
ntedgi / inline_and _refied.kt
Last active April 8, 2020 06:50
inline and refied
fun main() {
inline fun File.forEachFileInline(each: (File)->Unit) = listFiles().forEach(each)
fun File.forEachFile(each: (File)->Unit) = listFiles().forEach(each)
//inline
run{
https://reactjsexample.com/a-react-library-for-generating-a-tree-graph-from-data-using-d3/
@ntedgi
ntedgi / frequency_top_100.csv
Last active August 25, 2020 07:45
Medium Blog
frequency hashtag
58197 COVID19
7741 Covid19
6659 covid19
5216 coronavirus
1794 Coronavirus
980 pandemic
724 India
618 corona
602 lockdown
//+-------------------------------------------------------------------+
//| DWX_ZeroMQ_Service_v1.0.0.mq5 |
//| Based on DWX_ZeroMQ_Server_v2.0.1_RC8.mq4 |
//+-------------------------------------------------------------------+
#property service
#property copyright "Copyright 2017-2019, Darwinex Labs."
#property link "https://www.darwinex.com/"
#property version "1.0.0"
// Required: MQL-ZMQ from https://github.com/dingmaotu/mql-zmq