Skip to content

Instantly share code, notes, and snippets.

View chrdek's full-sized avatar
♻️
Fully reCaptcha resistant....

ChrDek chrdek

♻️
Fully reCaptcha resistant....
  • Ham
  • Bacon
View GitHub Profile
@chrdek
chrdek / pdfstaple.bat
Last active January 16, 2018 18:11
PDF files stapler using convert from imagemagick
cls
@echo Merging set of pdf files under %USERPROFILE%\Documents\mypdfs\ ..
@echo off
@echo.
set pdfpath= %USERPROFILE%\Documents\mypdfs\
rem Enable this line to avoid long file path name problems:
rem set pdfpath=%SystemDrive%\1\
for /r %pdfpath% %%i in (*.pdf) do echo | set /p pdfnames="%%i " >> %pdfpath%output3.txt
set /p outpdf=< %pdfpath%output3.txt
convert -density 180 %outpdf% %pdfpath%allinone.pdf
@chrdek
chrdek / pdf2img2zip.bat
Created January 5, 2018 11:28
PDF convert pages to image and add to archive (Using 7zip and Imagemagick)
REM Change the extension of the output file accordingly:
REM jpg jpeg,png,gif,tiff
cls
@echo Convert/Zip operation of pdfs started...
@echo off
@echo.
forfiles /m *.pdf /C "cmd /C convert -density 300 -compress lzw @file [email protected]"
dir *.png /B >> listfile.txt
"%ProgramFiles%\7-Zip\7z.exe" a -tzip -mx=8 pdf2png.zip @listfile.txt
del /q *.png
@chrdek
chrdek / Hundred-OneLines.psm1
Last active August 28, 2024 08:04
One hundred and one (one-liners) of Powershell for Computer Info.
<##
#
#
# MODULE OF:
#
#
# ..One-Hundred-and-One one-liners of powershell..
#
# Author: Chris Dek.
#
@chrdek
chrdek / pdfslicebynum.bat
Created January 16, 2018 15:59
PDF page slicer (by page number) using convert from imagemagick
REM Use this file to extract a specific page from a pdf..
cls
@echo off
@echo.
REM Default pdf files path..
SET pdfpath=%USERPROFILE%\Documents\mypdfs\
SET /P pagenum="Enter the pdf page you need here:"
SET /A "page=%pagenum%-1"
SET /P filename="Enter the pdf file name here:"
@echo.
@chrdek
chrdek / PDF-Redact.ps1
Last active April 17, 2024 16:33
PDF files content redaction by usage of ImageMagick
<#
Author: Chris Dek.
.Synopsis
This is a powershell utility script that redacts content (via black rounded rectangles) based on an image coordinate file.
Details for usage are shown in the sections below.
.Description
PDF file Content Redaction with usage of Imagemagick.This file generates the necessary ImageMagick commands to convert a set of images extracted from a pdf
@chrdek
chrdek / ipfind.js
Created September 1, 2018 23:42
http address to ip address value script sample
f=s=>{var t=[...s].reduce((c,i)=>i.charCodeAt(0)+c,0);return[1,2,3,4].map((n)=>n*t%256)}
@chrdek
chrdek / ipfind2.js
Created September 3, 2018 10:22
http address to ip address generator (2nd version)
f=s=>{t=eval([...s].map((k,v)=>s.charCodeAt(v)).join('+'));return [1,2,3,4].map((n)=>n*t%256)}
@chrdek
chrdek / exportproclines.ps1
Created September 13, 2018 16:50
export specific processes to file
$d=(gps chrome*,security*|Select ProcessName,Id -First 1 -Last 1);$c=[String]::Concat($d.ProcessName.SubString(0,1).toLower());$o=$c[1]+$c[0];$v=$d[0].ProcessName+","+$d[0].Id+","+$d[1].ProcessName+","+$d[1].Id;Start-Process powershell.exe -ArgumentList @($o,"-Value $v","-Path .\Out1.txt");
@chrdek
chrdek / ipfindv3.js
Created September 13, 2018 21:03
http to ip address convert. test 3
f=s=>{k=t=0;[...s].map(c=>t+=s.charCodeAt(k++));return[1,2,3,4].map(n=>n*t%256)}
@chrdek
chrdek / ipfindtest.js
Created September 14, 2018 16:05
http to ip convert 4
f=s=>{k=t=0;for(c of s)t+=c.charCodeAt();return[1,2,3,4].map(n=>n*t%256)}