Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
declare -a arr=("docker", "docker-compose", "znc", "caddy")
for i in "${arr[@]}"
do
systemctl status ${i} | sed '1q;d'
systemctl status ${i} | sed '3q;d'
echo
done
jobstr = '<job><script language="JScript">WScript.CreateObject("WScript.Network").MapNetworkDrive("{0}", "{1}");</script></job>'.format(letter, share)
tfile = tempfile.NamedTemporaryFile()
tfile.write(str.encode(jobstr))
proc = subprocess.Popen('wscript.exe {}'.format(tfile), stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
drives = [
{ 'hName': 'Archive','oName': 'O:','hRead': r'\\archive\Archive','sRead': r'\\\\archive\\Archive' },
{ 'hName': 'Backup','oName': 'Z:','hRead': r'\\backup\Backup','sRead': r'\\\\backup\\Backup' },
{ 'hName': 'Home','oName': 'H:','hRead': r'\\home\Home','sRead': r'\\\\home\\Home' },
{ 'hName': 'Install','oName': 'I:','hRead': r'\\install\install','sRead': r'\\\\install\\Install' },
{ 'hName': 'Release','oName': 'R:','hRead': r'\\release\Release','sRead': r'\\\\release\\Release' },
{ 'hName': 'Src','oName': 'S:','hRead': r'\\src\Src','sRead': r'\\\\src\\Src' },
{ 'hName': 'Tools','oName': 'T:','hRead': r'\\tools\Tools','sRead': r'\\\\tools\\Tools' },
{ 'hName': 'Work','oName': 'W:','hRead': r'\\work\Work','sRead': r'\\\\work\\Work' }
]
@arkag
arkag / tempfile.py
Last active May 19, 2017 17:55
tempfile hates me.
tfile = tempfile.NamedTemporaryFile(mode='w+', suffix='.wsf')
tfile.write('<job><script language="JScript">WScript.CreateObject("WScript.Network").MapNetworkDrive("{0}", "{1}");</script></job>'.format(letter, script_path))
tfile.flush()
proc = subprocess.Popen('wscript.exe {}'.format(tfile.name), stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
ERROR: Trailing whitespace found in ./server-post.yml on lines: 6
ERROR: Trailing newline found at the end of ./wiki.yml.
ERROR: Trailing newline found at the end of ./workstation-fedora.yml.
ERROR: Trailing newline found at the end of ./server-eset.yml.
ERROR: Trailing newline found at the end of ./server-zimbra.yml.
ERROR: Trailing newline found at the end of ./server-pwpush.yml.
ERROR: Trailing newline found at the end of ./workstation-linux.yml.
ERROR: Trailing newline found at the end of ./server-bf-router.yml.
ERROR: Trailing whitespace found in ./server-mail.yml on lines: 6
ERROR: Trailing newline found at the end of ./server-docserve.yml.
--> Executing ansible-lint...
ERROR: Trailing newline found at the end of ./wiki.yml.
ERROR: Trailing newline found at the end of ./workstation-fedora.yml.
ERROR: Trailing newline found at the end of ./server-eset.yml.
ERROR: Trailing newline found at the end of ./server-zimbra.yml.
ERROR: Trailing newline found at the end of ./server-pwpush.yml.
ERROR: Trailing newline found at the end of ./workstation-linux.yml.
ERROR: Trailing newline found at the end of ./server-bf-router.yml.
ERROR: Trailing newline found at the end of ./server-docserve.yml.
ERROR: Trailing newline found at the end of ./server-jenkins.yml.
aroberts@aroberts1 ~ $ xonfig
+------------------+---------------------+
| xonsh | 0.5.12 |
| Git SHA | 8941dfdd |
| Commit Date | Jun 7 16:04:39 2017 |
| Python | 3.5.2 |
| PLY | 3.9 |
| have readline | True |
| prompt toolkit | 1.0.14 |
| shell type | prompt_toolkit |
//
lockPref("plugin.state.flash",1);
lockPref("plugin.default_plugin_disabled", true);
lockPref("signon.rememberSignons", false);
defaultPref("browser.startup.homepage", "https://google.com")
paths = [ "$HOME/bin", "/usr/local/bin", "/usr/lib/python2.7/dist-packages", "/usr/lib/python3/dist-packages"]
for i in paths:
$PATH.append(i)
mpw() {
_copy() {
xclip -selection clip
echo >&2 "Copied!"
}
# Empty the clipboard
:| _copy 2>/dev/null
# Start Master Password and copy the output.