fixed bug that caused an alleged decompression DOS attack

clean_emacs
TuDatTr 2017-12-21 02:30:19 +01:00
parent ab13b5e4d2
commit e0af067cc7
3 changed files with 47 additions and 47 deletions

View File

@ -3,22 +3,24 @@
# A script to manage my dotfiles and copy them to my git
dotfiles=$HOME/workspace/Git/dotfiles
# -avv for debugging purposes
# -v for normal use
copy(){
rsync -avv $HOME/$1 $dotfiles/$1
# rsync -avv $HOME/$1 $dotfiles/$1
rsync -a $HOME/$1 $dotfiles/$1
}
# For Debugging purposes
copy_test(){
echo rsync -a $HOME/$1 $dotfiles/$1
echo rsync -avv $HOME/$1 $dotfiles/$1
}
# i3 gaps
# Powerline fonts must be installed
printf "\nCopying i3 configs...\n"
copy .config/i3/
# Termite
printf "\nCopying Termite configs...\n"
copy .config/termite/

View File

@ -1,24 +1,30 @@
import os
from PIL import Image
import datetime
import os
from PIL import Image
def screenshot():
os.system('import -window root /tmp/.i3lock.png')
os.system('import -window root /tmp/i3lock.png')
def pixelate():
# backgroundColor = (0,)*3
pixelSize = 9
image = Image.open('/tmp/.i3lock.png')
image_x, image_y = image.size
image = Image.open('/tmp/i3lock.png')
image_x = image.size[0]
image_y = image.size[1]
image = image.resize((int(image_x / pixelSize), int(image_y / pixelSize)),
Image.NEAREST)
image_x = image.size[0]
image_y = image.size[1]
image = image.resize((image_x * pixelSize, image_y * pixelSize),
Image.NEAREST)
# pixel = image.load()
# image.load()
# for i in range(0,image.size[0],pixelSize):
# for j in range(0,image.size[1],pixelSize):
@ -26,11 +32,11 @@ def pixelate():
# pixel[i+r,j] = backgroundColor
# pixel[i,j+r] = backgroundColor
image.save('/tmp/.i3lock.png')
image.save('/tmp/i3lock.png')
def getResolution():
image = Image.open('/tmp/.i3lock.png')
image = Image.open('/tmp/i3lock.png')
return image.size
@ -78,8 +84,7 @@ def lock_config():
lock_ver_color = '--insidevercolor 00000000 '
# Color of the circle if wrong | Color: transparent
lock_wrong_color = '--insidewrongcolor 00000000 '
indicator_inner = "{} {} {}".format(lock_rest_color,
lock_wrong_color,
indicator_inner = "{} {} {}".format(lock_rest_color, lock_wrong_color,
lock_ver_color)
# indicator_outer_ring
@ -94,26 +99,19 @@ def lock_config():
# Color on Deletion | Color: orange
lock_del = '--bshlcolor D13400FF'
# Color of seperator | Color: dark-blue
lock_sep_color = '--seperatorcolor 0000D1FF'
lock_sep_color = '--separatorcolor 0000D1FF'
indicator_outer_ring = "{} {} {} {} {} {}".format(lock_ring,
lock_ring_w,
lock_ring_v,
lock_press,
lock_del,
lock_sep_color)
indicator_outer_ring = "{} {} {} {} {} {}".format(lock_ring, lock_ring_w,
lock_ring_v, lock_press,
lock_del, lock_sep_color)
# done
indicator = "{} {}".format(indicator_inner, indicator_outer_ring)
# background
lock_pic = '-i /tmp/.i3lock.png'
lock_pic = '-i /tmp/i3lock.png'
return "{} {} {} {} {}".format(lock_core,
clock,
datetime,
indicator,
lock_pic
)
return "{} {} {} {} {}".format(lock_core, clock, datetime, indicator,
lock_pic)
def log_command(command):