Skip to content

Instantly share code, notes, and snippets.

View nascarsayan's full-sized avatar
🎯
Focusing

Sayan Naskar nascarsayan

🎯
Focusing
  • Microsoft
  • Kolkata, India
View GitHub Profile
@nascarsayan
nascarsayan / local.conf
Created February 28, 2018 15:00
Local conf for devstack
[[local|localrc]]
ADMIN_PASSWORD=secret
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
HOST_IP=<ip from ifconfig>
LOGFILE=$DEST/logs/stack.sh.log
LOGDAYS=2
SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
SWIFT_REPLICAS=1
@nascarsayan
nascarsayan / installation.md
Last active March 10, 2018 06:05
devstack.md

After fresh ubuntu 16.04 installation :

  1. Open proxy settings and add proxy hostname and port to all fields. Click on "Apply system wide".

  2. Install git and export no_proxy:

  • Open a terminal
sudo apt install git
echo "export no_proxy=localhost,127.0.0.0/8,::1,127.0.0.1,10.14.97.240,local" | sudo tee -a /etc/environment
@nascarsayan
nascarsayan / DOceanInit.sh
Last active June 29, 2018 03:34
DigitalOcean droplet init
sudo apt update
sudo add-apt-repository ppa:nilarimogard/webupd8 -y
sudo add-apt-repository ppa:aacebedo/fasd -y
sudo apt update
sudo apt upgrade -y
sudo apt install git aria2 youtube-dl zsh fasd -y
wget https://mega.nz/linux/MEGAsync/xUbuntu_16.04/amd64/megacmd-xUbuntu_16.04_amd64.deb -O megacmd.deb
sudo dpkg -i megacmd.deb
sudo apt install -f -y
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
@nascarsayan
nascarsayan / renameillegalfiles.py
Created March 13, 2018 16:20 — forked from openp2pdesign/renameillegalfiles.py
Check and rename files with illegal chars
# -*- encoding: utf-8 -*-
#
# Author: Massimo Menichinelli
# Homepage: http://www.openp2pdesign.org
# License: MIT
#
import string
import os
sudo rm -rf /etc/apt/sources.list
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu xenial main restricted multiverse universe" | sudo tee --append /etc/apt/sources.list
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu xenial-updates main restricted multiverse universe" | sudo tee --append /etc/apt/sources.list
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu xenial-security main restricted multiverse universe" | sudo tee --append /etc/apt/sources.list
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu xenial-backports main restricted multiverse universe" | sudo tee --append /etc/apt/sources.list
sudo apt update
sudo add-apt-repository ppa:nilarimogard/webupd8 -y
sudo add-apt-repository ppa:aacebedo/fasd -y
sudo apt update
sudo apt upgrade -y
@nascarsayan
nascarsayan / compile.sh
Last active January 14, 2020 06:32
Lab 2 - Circle
gcc -o circle.o circle.c -lm
./circle.o < in1 > circle.out
./circle.o < in2 >> circle.out
./circle.o < in3 >> circle.out
@nascarsayan
nascarsayan / settings.json
Last active May 16, 2023 09:10
Wndows Terminal Config
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
@nascarsayan
nascarsayan / customStyle.js
Last active March 28, 2021 06:39
Tampermonkey script for customizing the code UI.
// ==UserScript==
// @name Code customizer
// @description Custom css setter : 1. Set monospace font on websites 2. Set tab width
// @namespace local.greasemonkey.codecustomizer
// @include *
// @version 1
// @grant none
// @author nascarsayan@gmail.com
// ==/UserScript==
@nascarsayan
nascarsayan / functions.ps1
Last active July 16, 2021 07:06
Powershell Functions
$VMMUname = ''
$VMMPass = ''
$Sess = @{}
function Show-VMMMemory {
[alias("vmmspec")]
param()
$hostname = $Sess['vmm'].ComputerName
Write-Output "Getting memory spec details for $hostname ..."
Invoke-Command -Session $Sess['vmm'] {
# * Powershell
ubuntu_ver=$(cut -f2 <<< $(lsb_release -r))
# Download the Microsoft repository GPG keys
wget -q "https://packages.microsoft.com/config/ubuntu/${ubuntu_ver}/packages-microsoft-prod.deb"
# Register the Microsoft repository GPG keys
sudo dpkg -i packages-microsoft-prod.deb