Skip to content

Instantly share code, notes, and snippets.

View imsurinder90's full-sized avatar

Surinder Kumar imsurinder90

  • Bangalore
View GitHub Profile
@imsurinder90
imsurinder90 / Create remote central repo.txt
Created August 14, 2020 16:20
Guide on how to setup a remote repository on remote server or location in Git
The best practice to share code using Git is to setup a remote repository on some server <ServerA> at a location /usr/git/. We will now create a
repo at this location which will act as a central repo where multiple remote users can get access to the code and even can push/pull the code.
Let's say we have a central server where Git code will present and
2 remote user User A and User B.
Simple steps:
1. Now, go to central server and then create a project folder, type:
user@central_server: mkdir /usr/git/<project name>
@imsurinder90
imsurinder90 / restart_wifi.sh
Last active July 24, 2018 10:40
Restart WiFi in Raspberry PI when connection drops
create a new file /usr/local/bin/restart_wifi.sh
and put below script in it.
ping -c4 192.168.1.1 > /dev/null
if [ $? != 0 ]
then
echo "No network connection, restarting wlan0"
sudo systemctl daemon-reload
sleep 5
@imsurinder90
imsurinder90 / record2wav.py
Last active July 10, 2018 10:03
Record audio in wav format
import pyaudio
import wave
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100
CHUNK = 1024
RECORD_SECONDS = 5
WAVE_OUTPUT_FILENAME = "file.wav"
@imsurinder90
imsurinder90 / stt3.py
Last active July 10, 2018 07:47
PocketSphinx speech to text convertor
from pocketsphinx.pocketsphinx import *
from sphinxbase.sphinxbase import *
import os
import pyaudio
import wave
import audioop
from collections import deque
import time
import math
@imsurinder90
imsurinder90 / webpack.config.js
Created July 20, 2017 17:08
pgAdmin4 webpack configuration files
/* eslint-env node */
// Import file, libraries and plugins
const path = require('path');
const webpack = require('webpack');
const sourceDir = __dirname + '/pgadmin/static';
// webpack.shim.js contains path references for resolve > alias configuration
// and other util function used in CommonsChunksPlugin.
const webpackShimConfig = require('./webpack.shim');
const PRODUCTION = process.env.NODE_ENV === 'production';
const envType = PRODUCTION ? 'prod': 'dev';