Skip to content

Instantly share code, notes, and snippets.

@0x2a94b5
0x2a94b5 / tomcat_script.sh
Last active February 28, 2019 16:44 — forked from miglen/Apache Tomcat 8 Start stop script init.d script
use non-root user: useradd -r -d /usr/local/tomcat tomcat ; non-root restart: sudo service tomcat restart
#!/bin/bash
#
# Tomcat 8 start/stop/status init.d script
# Initially forked from: https://gist.github.com/valotas/1000094
# @author: Miglen Evlogiev <bash@miglen.com>
#
# Release updates:
# Updated method for gathering pid of the current proccess
# Added usage of CATALINA_BASE
# Added coloring and additional status
@0x2a94b5
0x2a94b5 / get_latency.py
Created April 15, 2020 03:43
Network Latency For Windows
#!.venv/bin/python3.6
# -*- coding:utf-8 -*-
#
# Network Latency For Windows
#
import sys
from re import findall
from subprocess import Popen, PIPE
# pip install validators=0.14.3
@0x2a94b5
0x2a94b5 / TeamViewer-15-id-changer-for-mac.py
Last active December 21, 2023 00:24 — forked from zhenhappy/tv-changer-for-mac.py
Teamviewer 15 id changer for Mac OS X
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# System: macOS Mojave 10.14.6
# Version: TeamViewer v15.2.2756
# Python: 2.7.10
# Command: sudo python TeamViewer-15-id-changer-for-mac.py
#
import os
@0x2a94b5
0x2a94b5 / getHostname.py
Created July 20, 2020 11:42
get hostname on windows
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# get local computer name on windows
# package: pyinstaller -y -F -c getHostname.py
#
from subprocess import run, PIPE
cmd = "C:\\Windows\\System32\\HOSTNAME.EXE"
@0x2a94b5
0x2a94b5 / getMac.py
Created July 21, 2020 10:56
Get mac address on windows
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Get mac address on windows
# Package: Pyinstaller -y -F -c getMac.py
#
from subprocess import run, PIPE
try:
@0x2a94b5
0x2a94b5 / taskKill.py
Created July 23, 2020 04:55
terminate an application
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Termainate an application on windows
#
from subprocess import run, CalledProcessError
def taskCheck(name):
cmd = "tasklist | findstr %s" % name
@0x2a94b5
0x2a94b5 / getOutputPyQt5Sample.py
Created July 26, 2020 06:41
PyQt5 runs system commands and gets the output
#!/usr/bin/env python3
#
# PyQt5 executes commands on the windows system and gets the output.
# Package: pyinstaller -y -F -w pyqt5RunCommandSample.py
# Require: Python==3.6.8 PyQt5==5.15.0 PyInstaller==3.6
#
import re
import sys
@0x2a94b5
0x2a94b5 / getExePath.py
Created July 29, 2020 08:07
Get the running path of the pyinstaller program.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Get the running path of the pyinstaller program
# Package: pyinstaller -y -F D:\Temp\getExePath.py --add-binary "D:\Temp\dist\tmp.exe;dist/"
# Reference: https://stackoverflow.com/a/44352931
#
import os
import sys
@0x2a94b5
0x2a94b5 / caddy.service
Last active August 29, 2020 06:42 — forked from mosquito/README.md
Add caddy doker-compose as a systemd unit
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/local/bin/docker-compose -f /home/user/caddy/docker-compose.yml up -d
ExecStop=/usr/local/bin/docker-compose -f /home/user/caddy/docker-compose.yml down
@0x2a94b5
0x2a94b5 / .gitignore
Created November 7, 2020 10:42
Terminal Services session event monitor for http://superuser.com/q/264935
__pycache__
events.py