Skip to content

Instantly share code, notes, and snippets.

View NISH1001's full-sized avatar
💭
Staring into the abyss...

Nish NISH1001

💭
Staring into the abyss...
View GitHub Profile
@NISH1001
NISH1001 / eval.py
Last active November 8, 2019 10:58
import os
import cv2
import shutil
import numpy as np
import skimage
from skimage import io
from skimage import transform as tf
import argparse
import torch
#!/usr/bin/env python3
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
import tweepy
import sys
class StdOutListener(StreamListener):
@NISH1001
NISH1001 / debunking-ai
Created April 27, 2019 05:10
Debunking AI " A though
It has been a year since I gave my talk titled "Debunking AI". Here's a mini thread representing my thoughts: [start]
"Debunking AI" : A Thread
A year ago, I had come to realize how misinformed most of the people were and how today's social media and marketing schemes have generated a type of misguided "fear" in people. [1/n]
The only fear should be the mishandling of algorithms and misdirected intellectual properties, which in some ways is related to privacy. [2/n]
Nevertheless, I tried to give the presentation from my engineering perspective as to how algorithms are powerful and stupid at the same time. [3/n]
I did try giving them perspective on trending topics like fake news, deep fakes, bots, and surveillance. [4/n]
And after a year, nothing has changed, except for the fact that the hype-train is still going on surrounding AI. [5/n]
It's okay to think AI as a part of a tool, to be able to integrate to existing systems allowing "human" in the loop. But from a developer/researcher/engineering perspective
@NISH1001
NISH1001 / markdownify.py
Created April 23, 2019 06:16
convert medium blog post into markdown
#!/usr/bin/env python3
import html2text
import requests
from bs4 import BeautifulSoup
class ManualError(Exception):
def __init__(self, args):
self.args = args
@NISH1001
NISH1001 / ffmpeg-audio-gif.sh
Last active March 6, 2024 18:44
merge audio with a looped GIF using ffmpeg
#!/bin/bash
echo "i am paradox"
#ffmpeg -i audio.mp3 -ignore_loop 0 -i test.gif -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -shortest -strict -2 -c:v libx264 -threads 5 -c:a aac -b:a 192k -pix_fmt yuv420p -shortest final.mp4
# ffmpeg -i audio.mp3 -ignore_loop 0 -i test.gif -shortest -strict -2 -c:v libx264 -threads 5 -c:a aac -b:a 192k -pix_fmt yuv420p -shortest final.mp4
# ffmpeg -i audio.mp3 -ignore_loop 0 -i test.gif -vf "scale=trunc(iw/2)*1:trunc(ih/2)*2" -shortest -strict -2 -c:v libx264 -threads 5 -c:a aac -b:a 192k -pix_fmt yuv420p -shortest final.mp4
@NISH1001
NISH1001 / sql-server-cdc.md
Last active April 30, 2024 13:24
CDC (change data capture) for Microsoft SQL server

MSSQL CLI

github...

UI

https://dbeaver.io/

sqlcmd -S <ip> -d <dbname> -U <username> -P <password> -I
@NISH1001
NISH1001 / scala.md
Created March 6, 2019 11:42
some scala shit

Data Type Conversion

//first read data to dataframe with any way suitable for you
var df: DataFrame = ???
val dfSchema = df.schema

import org.apache.spark.sql.functions._
import org.apache.spark.sql.types.DecimalType
dfSchema.foreach { field =>
 field.dataType match {
@NISH1001
NISH1001 / linux-noob.md
Last active March 27, 2020 02:02
linux command

Sort Filenames by Size

du ./ | sort -n -r | head -n 20

Search string in files

grep -rnw -e "string" .
@NISH1001
NISH1001 / hdfs.md
Last active March 12, 2019 19:49
Hadoop File System (HDFS) shit

Append File to File

hdfs dfs -appendToFile <src> <dest>

Echo to File

echo "hello world" | hadoop fs -appendToFile - /dir/hadoop/hello_world.txt
@NISH1001
NISH1001 / oracle.md
Last active July 9, 2021 05:21
oracle

Check If archivelog mode is enabled

select log_mode from v$database;

Enable Archive mode

alter database archivelog;