Skip to content

Instantly share code, notes, and snippets.

View hardikmdev's full-sized avatar

Hardik hardikmdev

View GitHub Profile

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

checkout content from a different branch.

git checkout targe_branch
git checkout src_branch  -- <content_dir>
git add <content>
## and continue... 
@hardikmdev
hardikmdev / Resource.cpp
Last active June 19, 2023 15:20
cpp :: time it
#include "resource.h"
using std::string;
Resource::Resource(string n) : name(n)
{
// std::cout << "constructing " << name << '\n';
}
Resource::Resource(const Resource& r) : name(r.name)
@hardikmdev
hardikmdev / get_ip_address.py
Last active April 20, 2022 05:13
get_public_ip_add.sh
# This example requires the requests library be installed. You can learn more
# about the Requests library here: http://docs.python-requests.org/en/latest/
from requests import get
ip = get('https://api.ipify.org').text
print('My public IP address is: {}'.format(ip))
@hardikmdev
hardikmdev / py_list_files_basis_ext.py
Last active June 6, 2022 08:09
Python :: time compare :: list files
import os
import pathlib
import timeit
import glob
def a():
path = pathlib.Path().cwd()
list_log_files = [str(f) for f in path.glob("*.log")]
def b():
@hardikmdev
hardikmdev / build_git_centos.sh
Created October 26, 2021 15:35
Install or build git from source for centos, build may be necessary as centos has older version of git on repo.
# git
app_name="git"
echo "===> Checking if $app_name is installed .."
# if yum list installed "$app_name" > /dev/null 2>&1; then
# echo "===> $app_name was already installed. Nothing was done"
# else
# echo "$app_name is not installed, installing now..."
# sudo yum install git -y
# sudo yum install git -y
@hardikmdev
hardikmdev / setup_remote_ui_to_centos.sh
Created October 26, 2021 15:33
Setup Remote UI to Centos
sudo yum clean all
sudo yum update -y
ip addr show
### Now Prepare machine to have UI & access for RDP reception.
sudo yum install -y epel-release
sudo yum groupinstall -y "Server with GUI"
sudo yum install -y tigervnc-server xrdp
# sudo yum install -y tigervnc-server
@hardikmdev
hardikmdev / build_aws_sdk_on_centos.sh
Created October 26, 2021 15:30
Building Aws CPP SDK on CentOS
#-------------------------------------------------------------
## PART 6B -- AWS SDK building on centos
#-------------------------------------------------------------
sudo yum install libcurl-devel openssl-devel libuuid-devel pulseaudio-libs-devel ## imp for sdk to build on centos
mkdir ~/code/aws && cd ~/code/aws
git clone https://github.com/awslabs/aws-lc.git
# cmake -S aws-lc -B aws-lc/build -DCMAKE_INSTALL_PREFIX=<install-path>
cmake -S aws-lc -B aws-lc/build