Skip to content

Instantly share code, notes, and snippets.

@gagarine
gagarine / install-clamav-osx.md
Last active June 7, 2023 07:54
Howto Install clamav on OSX with brew

Howto Install clamav on OSX with brew

Note: on legacy intel system the path may be /usr/local/etc/clamav instead of /opt/homebrew/etc/clamav/

$ brew install clamav
$ cd /opt/homebrew/etc/clamav/
$ cp freshclam.conf.sample freshclam.conf
@oifland
oifland / Jenkinsfile
Last active March 23, 2024 17:59
Loops in Jenkinsfiles
// Related to https://issues.jenkins-ci.org/browse/JENKINS-26481
abcs = ['a', 'b', 'c']
node('master') {
stage('Test 1: loop of echo statements') {
echo_all(abcs)
}
stage('Test 2: loop of sh commands') {
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active May 9, 2024 20:15
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@turtlemonvh
turtlemonvh / install_duc_osx.sh
Last active November 4, 2016 12:08
Installing duc on OSX
#!/usr/bin/bash
# DUC: http://duc.zevv.nl/
TKC_VERSION=1.4.48
DUC_VERSION=1.4.0
GLFW_VERSION=3.1.2
if ! which brew ; then
echo "ERROR: brew is required"
@Khoulaiz
Khoulaiz / gist:41b387883a208d6e914b
Last active May 3, 2024 15:57
Checking ports without telnet

Here are several different ways to test a TCP port without telnet.

$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C

$ cat &lt; /dev/tcp/127.0.0.1/23
@a-chernykh
a-chernykh / script.js
Created November 20, 2014 23:23
Delete all Jenkins jobs produced by "Build Per Branch"
for(job in jenkins.model.Jenkins.theInstance.getProjects()) {
if (job.name != 'project-test-master' && job.name.indexOf('project-test') > -1) {
job.delete();
}
}
@PeteLawrence
PeteLawrence / better-apt-mirrors
Last active March 6, 2018 05:07
The standard /etc/apt/sources.list file points to us.archive.ubuntu.com, which in my experience is pretty slow. This command will replace the contents of sources.list, and will tell apt-get to select a better mirror
cat >/etc/apt/sources.list << EOL
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty-security main restricted universe multiverse
EOL
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active April 1, 2024 11:21
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@sawanoboly
sawanoboly / haproxy.cfg
Created November 15, 2011 10:28
mongos behind haproxy configuration.
global
daemon
user haproxy
group haproxy
log /dev/log daemon info
maxconn 4096
defaults
log global
option dontlognull
@mikeyk
mikeyk / redis_session_backend.py
Created April 8, 2011 18:01
A redis backend for Django Sessions, tested on Django 1.3+
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.conf import settings
from django.utils.encoding import force_unicode
import redis
class SessionStore(SessionBase):
""" Redis store for sessions"""
def __init__(self, session_key=None):
self.redis = redis.Redis(