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/php | |
<?PHP | |
function xmlToCommand($xmlFile){ | |
global $var; | |
$doc = new DOMDocument(); | |
$doc->loadXML($xmlFile); | |
$Name = $doc->getElementsByTagName( "Name" )->item(0)->nodeValue; | |
$cmdName = (strlen($Name)) ? '--name="' . $Name . '"' : ""; | |
$Privileged = $doc->getElementsByTagName( "Privileged" )->item(0)->nodeValue; |
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 python3 | |
import re, sys, os, json, datetime, urllib.request, unicodedata, pprint | |
from pyriscope.__main__ import main | |
from bs4 import BeautifulSoup | |
def unique(items): | |
found = set([]) | |
keep = [] | |
for item in items: | |
if item not in found: |
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
function listDir($root) { | |
$iter = new RecursiveIteratorIterator( | |
new RecursiveDirectoryIterator($root, | |
RecursiveDirectoryIterator::SKIP_DOTS), | |
RecursiveIteratorIterator::SELF_FIRST, | |
RecursiveIteratorIterator::CATCH_GET_CHILD); | |
$paths = array(); | |
foreach ($iter as $path => $fileinfo) { | |
if (! $fileinfo->isDir()) $paths[] = $path; | |
} |
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
function listDir($root, $filter=null) { | |
$iter = new RecursiveIteratorIterator( | |
new RecursiveDirectoryIterator($root, | |
RecursiveDirectoryIterator::SKIP_DOTS), | |
RecursiveIteratorIterator::SELF_FIRST, | |
RecursiveIteratorIterator::CATCH_GET_CHILD); | |
$paths = array(); | |
foreach ($iter as $path => $fileinfo) { | |
if ($filter && is_bool(strpos($path, $filter))) continue; | |
if (! $fileinfo->isDir()) $paths[] = $path; |
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
$plugin = "unassigned.devices"; | |
$paths = array("smb_extra" => "/boot/config/smb-extra.conf", | |
"smb_usb_shares" => "/etc/samba/unassigned-shares", | |
"usb_mountpoint" => "/mnt/disks", | |
"log" => "/var/log/{$plugin}.log", | |
"config_file" => "/boot/config/plugins/{$plugin}/{$plugin}.cfg", | |
"state" => "/var/state/${plugin}.ini", | |
"samba_mount" => "/boot/config/plugins/${plugin}/samba_mount.cfg" | |
); |
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 | |
D="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")" | |
BZROOT="/boot/bzroot" | |
URLS=" | |
http://mirrors.slackware.com/slackware/slackware64-14.1/slackware64/d/gcc-4.8.2-x86_64-1.txz | |
http://mirrors.slackware.com/slackware/slackware64-14.1/slackware64/d/gcc-g++-4.8.2-x86_64-1.txz | |
http://mirrors.slackware.com/slackware/slackware64-14.1/patches/packages/glibc-2.17-x86_64-10_slack14.1.txz | |
http://mirrors.slackware.com/slackware/slackware64-14.1/slackware64/d/binutils-2.23.52.0.1-x86_64-2.txz |