Skip to content

Instantly share code, notes, and snippets.

View namantam1's full-sized avatar
🎯
Focusing

Naman Tamrakar namantam1

🎯
Focusing
View GitHub Profile
@namantam1
namantam1 / ODE_1.m
Last active December 12, 2022 06:38
Matlab Codes
odefun = @(t, u) 4*exp(t) - 0.5*u;
[t, u] = ode45(odefun, [0, 4], 4);
plot(t, u, 'g-', 'LineWidth', 2);
hold on;
t0 = 0;
tend = 4;
@namantam1
namantam1 / main.cpp
Last active April 10, 2022 09:16
Command line Tic-Tac-Toe C++ game
#include <cstdlib>
#include <ctime>
#include <iostream>
using namespace std;
int check(char a[]);
void fill(char a[]);
int vuser(char a[]);
int check1(char a[]);
int check2(char a[]);
@namantam1
namantam1 / cpp.cpp
Created October 19, 2021 07:21
Some c++ useful things.
// std::advance : advances the iterator ‘it’ by n element positions.
std::advance(itr, 6); // move iterator by 6
@namantam1
namantam1 / docker-install.sh
Last active October 21, 2021 14:17
Docker install setup
echo ">> Update system..."
sudo apt update
echo ">> docker pre-setup"
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
echo ">> Add docker repo"
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
@namantam1
namantam1 / README.md
Last active November 3, 2021 09:12
Backup AWS RDS MYSQL database as dump file and upload it to any other MYSQL instance.
  • If want to work from MYSQL docker container.
docker-compose exec <service_name> bash
  • Backup as dump file
mysqldump -h <hostname> -u <username> -password <database_name> --triggers --routines --events > remote_db.sql