Skip to content

Instantly share code, notes, and snippets.

View anistark's full-sized avatar
💻
Open Innovation and Development

Ani anistark

💻
Open Innovation and Development
View GitHub Profile
@anistark
anistark / server_setup.md
Last active January 27, 2024 11:25
Server Setup

Setting Up Basic NodeJs Server with Postgres

sudo apt update
sudo apt upgrade
sudo apt install -y vim tree tmux npm git

Node v20
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
@anistark
anistark / run_shell.java
Created December 6, 2016 07:24
Run Shell CMD via code
import java.io.*;
class Main {
public static void main(String[] args) {
String command = "ls";
try {
Process process = Runtime.getRuntime().exec(command);
BufferedReader reader = new BufferedReader(
new InputStreamReader(process.getInputStream()));
String line;
while ((line = reader.readLine()) != null) {
@anistark
anistark / sqs.py
Created September 5, 2016 17:55 — forked from philchristensen/sqs.py
Minimal script for sending/reading from Amazon SQS using Boto/Python.
conf = {
"sqs-access-key": "",
"sqs-secret-key": "",
"sqs-queue-name": "",
"sqs-region": "us-east-1",
"sqs-path": "sqssend"
}
import boto.sqs
conn = boto.sqs.connect_to_region(
@anistark
anistark / postgresHelp.md
Last active January 10, 2018 08:47
Postgres Most used commands

Postgres

Run :

psql -d test -U postgres -W

Most frequently used commands :

@anistark
anistark / reinstallMeteor.sh
Last active August 20, 2016 09:02
Script to remove and install fresh meteor
#!/bin/bash
sudo mrt uninstall
sudo mrt uninstall --system
rm -rf ~/.meteorite
sudo rm /usr/local/bin/meteor
rm -rf ~/.meteor
sudo chown -R $(whoami) ~/.npm
@anistark
anistark / python_errors.md
Last active September 6, 2016 10:19
Common Python Errors

Common Python Errors and handling them

lxml error on mac

Occurance :

    #include "libxml/xpath.h"
             ^
 1 error generated.
@anistark
anistark / usefulCmds.md
Last active November 8, 2016 07:32
Useful Commands

Useful Commands

Create simple server on the current directory u r in

Python

python -m SimpleHTTPServer 8000
#import necessary libraries
import cv2
import numpy as np
#capture video from the webcam
cap = cv2.VideoCapture(0)
#load the face finder
face_cascade = cv2.CascadeClassifier('/home/sm/Desktop/haarcascade_frontalface_default.xml')
@anistark
anistark / ShellSettings.txt
Created March 15, 2016 20:06
Shell Settings
Clarification: There are two default shell settings.
One is the Unix setting and can be changed with chsh -s.
The other is the Terminal.app-specific setting, and can be changed in Terminal preferences.
You can set your Terminal default shell command to /bin/bash -l in the Terminal app.
-l tells Bash to read startup files. Even if you don't have any user-specific startup files, there are system-wide startup files that will, among other things, set the prompt to the one you're familiar with.
If you've properly set your Unix default shell, you should be able to select Default login shell in Terminal preferences and this will happen automatically.
@anistark
anistark / ubuntuTricks.md
Created February 4, 2016 07:40
Ubuntu Tips n Tricks
find . -maxdepth 1 -name "*.pdf" -print0 | xargs -0 rm