Skip to content

Instantly share code, notes, and snippets.

Avatar

Codarren Velvindron codarrenvelvindron

View GitHub Profile
@codarrenvelvindron
codarrenvelvindron / currency_limits_25032021.json
Last active Mar 25, 2021
beautified json output (from cex.io)
View currency_limits_25032021.json
{
"e": "currency_limits",
"ok": "ok",
"data": {
"pairs": [
{
"symbol1": "BTC",
"symbol2": "USD",
"pricePrecision": 1,
"minLotSize": 0.0004,
@codarrenvelvindron
codarrenvelvindron / convjson.py
Created Mar 25, 2021
Example for getting data from json file, made up of data dictionary and list
View convjson.py
#Convjson, an example for getting data from a json file
#25/03/2021
#By Codarren Velvindron
#Licence: MIT
import json
#we init an empty dictionary
crypto_dictionary = {}
View job1.txt
wordpress
member space --> training/coaching videos
parcours client --> client fidelity
Buy domain names --> make online websites
hosting management
latest technologies
Landing page --> user clicks on a link --> main markmeting page
View limit_api_requests.sh
#!/bin/bash
#Check modified date of file and return the time elapsed between modification and current time
#Limiting API curl requests with bash
#By Codarren Velvindron
#Credits: https://stackoverflow.com/questions/1819187/test-a-file-date-with-bash
CWD="$( cd "$(dirname "$0")" ; pwd -P )"
file="$CWD/myfile.txt"
API_Request='curl -G -H "your_api_key:xxxxxxxxxxxx" https://your.api.url/your/endpoint -o $file'
View start_firewall_rules.yml
---
- hosts: tls14
remote_user: secure
become: yes
become_method: sudo
tasks:
View firewall_rules.yml
tasks:
- name: Install iptables Persistent
apt: name=netfilter-persistent state=present update_cache=true
- name: Set Loop Back Rule
iptables:
chain: INPUT
in_interface: lo
jump: ACCEPT
comment: 'Accept all loop back traffic'
@codarrenvelvindron
codarrenvelvindron / fast_setup.sh
Created Mar 20, 2018
Prerequisites: Ubuntu, nvidia card, dev environment . Run as sudo user
View fast_setup.sh
#Add ubuntu package archive
echo "Adding ubuntu package archive to sources list"
sudo echo "deb-src http://archive.ubuntu.com/ubuntu/ xenial main" >> /etc/apt/sources.list
echo "Updating repo list"
sudo apt-get update
echo "Done.."
#Install graphics drivers
echo "Installing nvidia graphics drivers"
sudo apt-get purge nvidia
@codarrenvelvindron
codarrenvelvindron / sudo_creator.sh
Created Mar 20, 2018
Create sudo account and automatically switch to it through a shell script. Must be run as root. Works on Ubuntu, Fedora and should work on other linux distros as well.
View sudo_creator.sh
#!/usr/bin/env bash
#Add sudo user
echo "Enter account name to make sudo"
read account
adduser $account
echo "Done.."
#Adding username to sudo group
echo "Adding $account to sudo"
usermod -aG sudo $account