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
#!/usr/bin/env python | |
import errno | |
import os | |
import sys | |
import subprocess | |
#----------------------------------------------------------------------------- | |
def main(): | |
fileNames = sys.argv[1:] |
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
On Error Resume Next | |
Const ADS_SCOPE_SUBTREE = 2 | |
Dim strTimestamp | |
strTimestamp = "20120901000000.0Z" | |
set objRootDSE = GetObject("LDAP://RootDSE") | |
RootDN = objRootDSE.Get("defaultNamingContext")) | |
Set objConnection = CreateObject("ADODB.Connection") |
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
#!/usr/bin/python | |
import os, sys | |
import urlparse | |
from shutil import copyfileobj | |
from urllib import urlopen, unquote | |
from xml.etree import ElementTree as ET | |
from socket import error as socket_error | |
import socket |
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 | |
SAVEIFS=${IFS} | |
IFS=$(echo -en "\n\b") | |
THUMBNAIL_DIR=".thumbnails2" | |
THUMBNAIL_SIZE=170 | |
THUMBNAIL_PREFIX="thumbnail-" | |
override=0 |
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
Notice: Undefined index: access_token in /var/www/production/public/app/code/local/Wcm/Iqcloud/Helper/Api.php on line 72 | |
#0 /var/www/production/public/app/code/local/Wcm/Iqcloud/Helper/Api.php(72): mageCoreErrorHandler(8, 'Undefined index...', '/var/www/produc...', 72, Array) | |
#1 /var/www/production/public/app/code/local/Wcm/Iqcloud/Helper/Api.php(353): Wcm_Iqcloud_Helper_Api->getAccessToken() | |
#2 /var/www/production/public/app/code/local/Wcm/Iqcloud/Model/Observer.php(182): Wcm_Iqcloud_Helper_Api->api_update_customer(Object(Varien_Object)) | |
#3 /var/www/production/public/app/code/core/Mage/Core/Model/App.php(1358): Wcm_Iqcloud_Model_Observer->afterCustomerSave(Object(Varien_Event_Observer)) | |
#4 /var/www/production/public/app/code/core/Mage/Core/Model/App.php(1337): Mage_Core_Model_App->_callObserverMethod(Object(Wcm_Iqcloud_Model_Observer), 'afterCustomerSa...', Object(Varien_Event_Observer)) | |
#5 /var/www/production/public/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('customer_save_a...', Array) | |
#6 /var |
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 | |
/usr/bin/certbot renew | |
if test $(find /etc/letsencrypt/live/unifi.example.com/cert.pem -mmin -60) | |
then | |
/bin/systemctl stop unifi.service | |
/usr/bin/openssl pkcs12 -export -inkey /etc/letsencrypt/live/unifi.example.com/privkey.pem -in /etc/letsencrypt/live/unifi.example.com/fullchain.pem -out /tmp/unifi.example.com.p12 -name ubnt -password pass:temppass | |
/bin/keytool -importkeystore -deststorepass aircontrolenterprise -destkeypass aircontrolenterprise -destkeystore /opt/UniFi/data/keystore -srckeystore /tmp/unifi.example.com.p12 -srcstoretype PKCS12 -srcstorepass temppass -alias ubnt -noprompt | |
/bin/rm -f /tmp/unifi.example.com.p12 |
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
$ FILE=/some/path/to/file.txt | |
################################### | |
### Remove matching suffix pattern | |
################################### | |
$ echo ${FILE%.*} # remove ext | |
/some/path/to/file | |
$ FILE=/some/path/to/file.txt.jpg.gpg # note various file exts |
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
#!/usr/bin/env python | |
import os, sys, re, time | |
from shutil import copyfileobj | |
from urllib.request import urlopen, unquote | |
from xml.etree import ElementTree as ET | |
from socket import error as socket_error | |
import socket | |
import requests |
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 | |
SIZE=400 | |
cat >index.html<<EOF | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Thumbnail gallery</title> |
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/python3.6 | |
import pathlib | |
import shutil | |
import os | |
def filesize(path): | |
return path.stat().st_size | |
def biggest(folder): |
OlderNewer