Skip to content

Instantly share code, notes, and snippets.

@GOSHROW
GOSHROW / binarySplitHideReveal.py
Created May 8, 2021 16:55
Image Hiding by embedding the target image into the 2 LSBs of the cover image such that their resolution ratio is 4 : 1
import cv2
import numpy as np
def hideBinSplit(encryptedImgPath, coverImgPath, hiddenImgPath):
encryptedImg = cv2.imread(encryptedImgPath, 1)
coverImg = cv2.imread(coverImgPath, 1)
newCoverDims = [2 * dim for dim in encryptedImg.shape[:2]][::-1]
coverImg = cv2.resize(coverImg, newCoverDims)
for i in range(len(encryptedImg)):
for j in range(len(encryptedImg[0])):
@GOSHROW
GOSHROW / img-hide-find.py
Last active March 17, 2021 07:15
Hides and recovers an image's pixels into / from a Cover Image of atleast wice ravelled length. Uses the akgm keys from a json to work up the random sequence of inserting / getting pixels.
import cv2
import numpy as np
import json
def randomLiHide(keysTextPath, toHideImgPath, coverImgPath):
ao, c, l = 0, 0, 0
with open(keysTextPath) as jsonKeys:
akgm = json.load(jsonKeys)["akgm"]
ao, c = float(akgm[0]) / (int(akgm[0]) + 1), (1 + str(akgm[1]).count('0'))
imgShape = cv2.imread(toHideImgPath, 0).shape
@GOSHROW
GOSHROW / .i3-config
Created March 9, 2021 06:37
Derives basic functionality from default Manjaro i3 config, But far more accessible and personally rewarding
# i3 config file (v4)
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
# Set mod key (Mod1=<Alt>, Mod4=<Super>)
set $mod Mod4
# set default desktop layout (default is tiling)
# workspace_layout tabbed <stacking|tabbed>
# Configure border style <normal|1pixel|pixel xx|none|pixel>
@GOSHROW
GOSHROW / .zshrc-fun-prompt
Created March 8, 2021 17:43
Get your ZSH a tad bit more fun to stare at.
# This is a section of my ZSHrc file. Be sure to modify it for your selves.
echo -e "Oy ɢᴏsʜʀᴏᴡ! It is now $(date +%H:%M). Welcome back!\n"
sleep 0.5
echo " ¯\_( ❛︠ ͜ʖ ︡❛)_/¯\n\n"
zshexit() {
echo -e "\n\e[1mTussi Jaa Rahe Ho!\e[0m\n"
#! /bin/sh -
# Use this script to get logs of whether your fingers are on keys or mice
# Add the script to (X)session startup be it i3config or directly on xinitrc
# Daemonize a tool to read the actionLog for simple display
actionLog="./actionLogs.log"
# Keep this in accord with the scripts that aim to work upon the extracted data
# Also as a part of the permanent memory, the logs maybe used across sessions
bufferSwitchTime=30
@GOSHROW
GOSHROW / .vimrc
Last active February 3, 2021 20:19
Gets the job done, effeciently, smoothly and sufficiently
" If you are new to vimrc, rather than applying these, you might also like to look at VimL for further customizations
" Additionaly you can look at swapping tab with capslock just for Vim which I have implemented in my Xsession init
syntax on
set noeb
set nu
set ts=4 sts=4 sw=4 et sta
set ai
set ambw=single
@GOSHROW
GOSHROW / codestats-pump.zsh
Created December 23, 2020 18:49
Pumps up Code::Stats XP without actual typing. [ A cheat to their gamification, not recommended since it would become boring ]
#! /bin/zsh -
# This is a simple cURL statement as per <https://gitlab.com/code-stats/code-stats-zsh/-/blob/master/codestats.plugin.zsh> and I would recommend you purge this else it takes away the fun of Code::Stats
TimeToPush='strftime %Y-%m-%dT%H:%M:%S%z'
TimeReq=`eval $TimeToPush`
# TimeReq="2020-01-01T12:00:00+0530"
# Uncomment and Edit the previous line to get your preferred time/date for pumping the xP. The format followed is https://strftime.org/
@GOSHROW
GOSHROW / .term-zoom.sh
Last active November 29, 2020 08:57
Zooms In and Out Properly in urxvt.
#! /bin/zsh -
fontSize=16
fontName="MonoSpace"
# Adjust Base fontSize and Font Name accordingly
zoomCommandPrefix='printf "\33]50;%s\007" "xft:$fontName-'
# https://bbs.archlinux.org/viewtopic.php?pid=1584742#p1584742
# You can also opt to change .Xresources for fonts, more complications though
function checkReadability() {