new scriptz

This commit is contained in:
christalib 2018-12-15 14:28:29 +01:00
parent 9a0612ab76
commit dbe75f6de9
3 changed files with 71 additions and 0 deletions

12
eternal_loop_zip.sh Normal file
View file

@ -0,0 +1,12 @@
#!/bin/bash
INPUT=$1
while true;
do
file=$(zipinfo $INPUT | grep "\--" | awk '{print $9}')
echo "file :" $file
pass=$(echo $file | awk -F"." '{print $1}')
echo "pass: " $pass
unzip -P $pass $INPUT
INPUT=$file
done

28
highlight_colors.rb Normal file
View file

@ -0,0 +1,28 @@
#! /usr/bin/ruby
require 'chunky_png'
image1 = ChunkyPNG::Image.from_file(ARGV[0])
keyR = ARGV[1]
keyG = ARGV[2]
keyB = ARGV[3]
def go(r, g, b, image)
range = 2
if (r.to_i > 255) || (r.to_i < 0) || (g.to_i > 255) || (g.to_i < 0) || (b.to_i > 255) || (b.to_i < 0)
puts 'Invalid arguments. Syntax is ./findColorin [IMAGE] [R VALUE] [G VALUE] [B VALUE]'
return 0
end
(0..image.dimension.width - 1).each do |x|
(0..image.dimension.height - 1).each do |y|
if (image[x, y] > ChunkyPNG::Color.rgb(r.to_i - range, g.to_i - range, b.to_i - range)) && (image[x, y] < ChunkyPNG::Color.rgb(r.to_i + range, g.to_i + range, b.to_i + range))
image[x, y] = ChunkyPNG::Color.rgb(0, 0, 0)
else
image[x, y] = ChunkyPNG::Color.rgb(255, 255, 255)
end
end
end
puts 'Saving to output.png'
image.save('output.png')
end
go keyR, keyG, keyB, image1

31
import_zik.py Normal file
View file

@ -0,0 +1,31 @@
# /bin/python2
import mechanize
from time import sleep
br = mechanize.Browser()
# url here
br.open('')
# file type here
filetypes = ['.ogg', '.mp3']
my_files = []
for l in br.links():
for t in filetypes:
if t in str(l):
my_files.append(l)
def download_link(l):
f = open(l.text, 'w')
br.click_link(l)
f.write(br.response().read())
print(l.text, "has been downloaded")
for l in my_files:
sleep(1)
download_link(l)