This file contains 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
def dec(func): | |
_decorators = getattr(func, '_decorators', []) | |
if dec in _decorators: | |
print('Ignoring...') | |
return func | |
_decorators.append(dec) | |
def inner(*args, **kwargs): | |
print('Calling...') |
This file contains 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
# Authorization contains your username and password encoded in Base 64 | |
# Example: admin:password => YWRtaW46cGFzc3dvcmQ= | |
curl -X GET https://192.168.1.1/rebootinfo.cgi -H 'Cookie: Authorization=YWRtaW46cGFzc3dvcmQ=' -k |
This file contains 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 dpkg-repack | |
sudo dpkg-repack <package name> |
This file contains 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
def remove_selector(selector): | |
""" | |
Remove elements from the document based on a selector or list of selectors. | |
:param selector: Selector object or Selector iterable. | |
""" | |
if not hasattr(selector, '__iter__'): | |
selector = [selector] | |
for sel in selector: |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Boot Banner</key> | |
<string>No</string> | |
<key>EthernetBuiltIn</key> | |
<string>Yes</string> | |
<key>GraphicsEnabler</key> | |
<string>No</string> |
This file contains 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
Host <your host ip> | |
User <your host user> | |
Port <your host port> |
This file contains 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
/* | |
Copyright (c) 2017 Victor Torres | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
This file contains 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
[ui] | |
merge = meld | |
[extensions] | |
extdiff = | |
[merge-tools] | |
meld.args = $local $base $other --output=$output |
This file contains 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
# Convert and compress GoPro videos to reduce file size keeping regular quality | |
# Run in the same directory as the original files | |
# Output is MP4 H.264 | |
# Be awere that convertions may take several minutes or even hours! | |
# I do recommend to run with small sets of video files for each iteraction | |
time find . -type f -name "G*PR*.MP4" -exec handbrakecli -i {} -o /<dest dir>/{} -e x264 -x "level=4.0:vbv-maxrate=20000:weightp=1:vbv-bufsize=25000:ref=1:8x8dct=0:subme=2:mixed-refs=0:trellis=0:rc-lookahead=10" \; |
This file contains 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
#!/bin/bash | |
function die() { | |
echo "${1}" | |
exit 1 | |
} | |
which printf > /dev/null 2>&1 || die "Shell integration requires the printf binary to be in your path." | |
which sed > /dev/null 2>&1 || die "Shell integration requires the sed binary to be in your path." |
NewerOlder