Skip to content

Instantly share code, notes, and snippets.

@rahulkrishnanfs
rahulkrishnanfs / DappToken.sol
Last active April 5, 2021 16:49 — forked from gwmccubbin/DappToken.sol
DApp ERC-20 Token
pragma solidity ^0.5.0;
contract Token {
string public name = "DApp Token";
string public symbol = "DAPP";
uint256 public totalSupply = 1000000000000000000000000; // 1 million tokens
uint8 public decimals = 18;
event Transfer(
address indexed _from,
AWS CLI : aws ec2 describe-images --filters Name=name,Values=ubuntu*
Output:
{
"Images": [
{
"EnaSupport": true,
@rahulkrishnanfs
rahulkrishnanfs / kubernetes installation using kubeadm
Last active January 9, 2018 18:12
kubernetes installation using kubeadm
OS Required: Ubuntu 16 - xenial
Master node creation
---------------------------
The first step of initialising the cluster is to launch the master node.
The master is responsible for running the control plane components, etcd and the API server.
@rahulkrishnanfs
rahulkrishnanfs / gist:2424cd12429afbd9edb193c9115d1f5f
Created May 31, 2017 09:30
Bitbucket deployment in kubernetes
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: bitbucket
labels:
app : bitbucket
spec:
template:
@rahulkrishnanfs
rahulkrishnanfs / Ansible Dynamic inventory - Ansible
Created February 3, 2017 09:34
AWS Dynamic inventory Script Testing - Ansible
Tesing on
-------------------
Distributor ID: Debian
Description: Debian GNU/Linux 8.6 (jessie)
Release: 8.6
Codename: jessie
Steps to follow:
@rahulkrishnanfs
rahulkrishnanfs / Ansible Facts Indepth Analysis
Last active February 3, 2017 05:01
Parsing the Ansible Facts Gathered from the server using " -m setup "
Ansible Facts will be in Json object
@rahulkrishnanfs
rahulkrishnanfs / copy files with extention
Created February 2, 2017 13:16
copy files with extention
#!/bin/bash
SRC=$1
DEST=$2
EXT=$3
if [ -d $1 -a -d $2 ];then
for file in `ls *.$EXT `;do
name=$(echo $file | cut -d "." -f1)
if [ -d $DEST/$name ];then
cp $SRC/$file $DEST/$name/$file
@rahulkrishnanfs
rahulkrishnanfs / Realtime docker containers events
Created February 2, 2017 08:39
Intense Troubleshooting Docker
Intense Troubleshooting Docker
############ Debug the docker-engine
$dockerd --debug
Output
---------------------
DEBU[0000] docker group found. gid: 999
DEBU[0000] Listener created for HTTP on unix (/var/run/docker.sock)
INFO[0000] libcontainerd: new containerd process, pid: 7996
@rahulkrishnanfs
rahulkrishnanfs / docker info explanation
Last active February 2, 2017 08:31
Detailed information about the docker info
### Docker info
root@ip-10-0-2-87:~# docker info
Containers: 0 --------------------> ; Show containers present on the node evenif it is running or stopped
Running: 0 --------------------> ; Currently running container #### $docker ps
Paused: 0 --------------------> ; Paused Containers ;;##
; $docker unpause <Container ID> -> To unpause
Stopped: 0 --------------------> ; Currently stopeed containers #### $docker ps -a -------> To check the stopped containers
; $docker start <Container ID> ----> to start the container
@rahulkrishnanfs
rahulkrishnanfs / Adding repository in Debian and Ubuntu
Last active March 14, 2023 14:08
add-apt-repository for adding repository in /etc/apt/sources.list
We can add the repository url to the /etc/apt/sources.list using add-apt-repository
$ sudo apt-get install python-software-properties ---------------> Package name
#### Package will be available in https://packages.debian.org/jessie/admin/python-software-properties
example adding the docker repository to the debian sources.list
$ sudo add-apt-repository "deb https://apt.dockerproject.org/repo debian-$(lsb_release -cs) main"