Skip to content

Instantly share code, notes, and snippets.

@ziadoz
ziadoz / fix-osx-wifi-battery-drain.md
Last active March 25, 2024 13:42
Fix OSX battery draining on sleep due to wifi activity

Fix OSX battery draining on sleep due to wifi activity

Install SleepWatcher using Homebrew:

sudo chown -R $(whoami) /usr/local
brew update
brew install sleepwatcher

Start the SleepWatcher service:

@awlx
awlx / ciscoasa
Last active August 9, 2019 18:35 — forked from rootik/ciscoasa
Grok patterns
#== Cisco ASA ==
HOSTNAME \b(?:[_0-9A-Za-z][_0-9A-Za-z-]{0,62})(?:\.(?:[_0-9A-Za-z][_0-9A-Za-z-]{0,62}))*(\.?|\b)
CTIMESTAMP %{YEAR}-%{MONTHNUM2}-%{MONTHDAY}[T ]%{HOUR}:?%{MINUTE}(?::?%{SECOND})(?:\.[0-9]+)?%{ISO8601_TIMEZONE}
CISCO_TAGGED %{CTIMESTAMP}( %{SYSLOGHOST:host})? %{CISCO_TAG:ciscotag}:
CISCO_ASA_TAGGED %{CTIMESTAMP}( %{SYSLOGHOST:host})? %{CISCO_ASA_TAG:ciscotag}:
CISCO_CLASS [0-9]{3}
CISCO_STRUC [A-Z0-9_]+
CISCO_TAG %{CISCO_STRUC:cisco_facility}-%{INT:cisco_severity}-%{CISCO_STRUC:cisco_mnemonic}|WLC[0-9]+
CISCO_ASA_TAG %[A-Z0-9_]+-%{INT:cisco_severity}-%{CISCO_CLASS:cisco_class}[0-9]{3}
# Common Particles
#!/bin/sh
if [ "$1" ]
then
find "$1" -name '*.flac' | while read fn;
do
basename=$(basename "$fn" .flac).mp3
dirname=$(dirname "$fn")
outfile="$dirname/$basename"
{
"cmd": ["make"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${project_path:${folder}}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",
"working_dir": "${project_path:${folder}}",
@quickshiftin
quickshiftin / pem2pkcs12.sh
Created February 12, 2014 05:03
Convert a set of Apache ssl certificates to a format suitable for Jetty
#!/bin/bash
# -----------------------------------------------------------------------------------
# pem2pkcs12.sh
# (c) Nathan Nobbe 2014
# quickshiftin@gmail.com
# http://quickshiftin.com
#
# Use this script to convert a set of apache ssl certificates to a format suitable
# for Jetty.
#
@bendiy
bendiy / gist:7553882
Created November 19, 2013 22:41
Server Benchmarks
mkdir io-test
cd io-test/
wget www.iozone.org/src/current/iozone3_413.tar
tar -xvf iozone3_413.tar
rm iozone3_413.tar
cd iozone3_413/src/current/
make linux-AMD64
./iozone -RazMb io-test.xls
@kordless
kordless / .DS_Store
Last active June 9, 2020 13:55
Building a CentOS Image for OpenStack in 10 Minutes
@jacksoncage
jacksoncage / jenkins-slave
Last active December 8, 2023 23:40
Bash script to check if a Jenkins slave node is offline and will restart node java process.
#!/bin/sh
#
# jenkins-slave: Launch a Jenkins BuildSlave instance on this node
#
# chkconfig: - 99 01
# description: Enable this node to fulfill build jobs
#
JENKINS_WORKDIR="/var/jenkins"
JENKINS_USER="jenkins"
@bageljp
bageljp / put_mon.bash
Created April 16, 2013 04:47
CloudWatch custom metric put.
#!/bin/bash
#--------------------------------------
#
# Author(s):
#
# K.Kadoyama
#
# Usage:
#
# mon_put.bash
@anunay
anunay / modsecurity-whitelist.conf
Last active December 9, 2022 14:08
Whitelist IP in ModSecurity (whitelist.conf)
##Whitelist IP in ModSecurity
#1. If you need to whitelist an IP in ModSecurity (v2.7+), here’s what to do:
nano /usr/local/apache/conf/modsec2/whitelist.conf
#2. add this line, replacing (#####) with a unique ID number for mod security, I used a version of my whitelisted ip address:
SecRule REMOTE_ADDR "@ipMatch 1.2.3.4" "phase:1,t:none,nolog,allow,ctl:ruleEngine=Off,ctl:auditEngine=Off,id:(#####)"
#3. Then restart apache.