This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
An example of how to determine if an svg path is contained in another | |
svg path in Python. | |
Note: for discontinuous paths you can use the svgpathtools | |
Path.continuous_subpaths() method to split a paths into a list of its | |
continuous subpaths. | |
""" | |
from svgpathtools import * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import matplotlib.pyplot as plt | |
import ezdxf | |
from ezdxf.addons.drawing import RenderContext, Frontend | |
from ezdxf.addons.drawing.matplotlib_backend import MatplotlibBackend | |
doc = ezdxf.readfile(YOURFILE) | |
fig = plt.figure() | |
out = MatplotlibBackend(fig.add_axes([0, 0, 1, 1])) | |
Frontend(RenderContext(doc), out).draw_layout(doc.modelspace(), finalize=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ACL everything | |
date; | |
time (echo "Collecting files ..."; | |
(find / \( -path /cygdrive -o -path /dev -o -path /home -o -path /mnt -o -path /proc \) -prune -o ! -type l -print0 | xargs -0 stat -c "%a %n" ) > ~/ACLsToFix; | |
echo "Removing ACLs ..."; | |
find / \( -path /cygdrive -o -path /dev -o -path /home -o -path /mnt -o -path /proc \) -prune -o ! -type l -exec echo "setfacl -bk {}" \; -exec setfacl -bk {} \; ; | |
echo "Updating file permissions to non-ACL standard"; | |
while read i; do chmod -vc $i; | |
done < ~/ACLsToFix); | |
date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install ruby ruby-dev; sudo gem install colorls; echo "alias lc='colorls -lA --sd'" >> ~/.bashrc; source ~/.bashrc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /; (find / \( -path /cygdrive -o -path /dev -o -path /home -o -path /mnt -o -path /proc \) -prune -o -type f ! -type l -size -50b ! -name ".bashrc" -print0 | xargs -0 grep -a \!'<symlink>') > ~/symlinksToUpdate; sed -i 's/\x0//; s/\xa0//g; s/\xd7//g; s/\xff//g; s/\xfe//g' ~/symlinksToUpdate; while read i; do linkName=$(cut -d ':' -f1 <<< $i); target=$(cut -d ':' -f2 <<< $i | sed -r 's/!<symlink>//'); echo "ln -f -s $target $linkName"; ln -f -s $target $linkName; done < ~/symlinksToUpdate | |
#if there are still left some special chars in symlinksToUpdate then please dump it using command 'hexdump -C ~/symlinksToUpdate' to reveal more Unicode character codes | |
#if the ln script did not work please check if the file is in unix format. if not please convert using dos2unix ~/symlinksToUpdate | |
echo "Checking if there are still some dangling symlinks. If this is the case please fix them manually ..." | |
find / \( -path /cygdrive -o -path /dev -o -path /home -o -path /mnt -o -path /proc \) -prune -o -type l ! -exec t |