Skip to content

Instantly share code, notes, and snippets.

varnishtest "Long vcl/backend names"
server s1 {
rxreq
txresp -status 301 -hdr "Location: http://bar.example.com/bar"
expect req.http.host == "foo.example.com"
expect req.url == "/foo"
} -start
@jmara
jmara / howto_deb_repackage.txt
Created July 5, 2018 11:53 — forked from shamil/howto_deb_repackage.txt
Howto repackage deb packages
Use folowing steps to repackage dep package:
1: Extract deb package
# dpkg-deb -x <package.deb> <dir>
2: Extract control-information from a package
# dpkg-deb -e <package.deb> <dir/DEBIAN>
3. After completed to make changes to the package, repack the deb
# dpkg-deb -b <dir> <new-package.deb>

Keybase proof

I hereby claim:

  • I am jmara on github.
  • I am jmara (https://keybase.io/jmara) on keybase.
  • I have a public key ASCMoX95KuWI-ZhFqWia4hn7Iz1UZPnUhTfmlcae8sHFOQo

To claim this, I am signing this object:

import hudson.util.RemotingDiagnostics;
script = 'def proc = "ls -1 /media".execute(); proc.waitFor(); println proc.in.text';
for (slave in Jenkins.instance.slaves) {
println slave.name;
try {
println RemotingDiagnostics.executeGroovy(script, slave.getChannel());
} catch (all) {
all.printStackTrace();
@jmara
jmara / SSLPoke.java
Created February 27, 2017 08:57 — forked from 4ndrej/SSLPoke.java
Test of java SSL / keystore / cert setup. Check the commet #1 for howto.
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
public static void main(String[] args) {
@jmara
jmara / parse-tcpdump-udp-port-53.php
Created January 24, 2017 09:53 — forked from jtai/parse-tcpdump-udp-port-53.php
Quick and dirty script to parse output of /usr/sbin/tcpdump -vvv -s 0 -l port 53
<?php
// quick and dirty argument parsing
foreach ($argv as $arg) {
if ($arg == '-f') {
define('FOLLOW', true);
}
if ($arg == '-h') {
define('HISTOGRAM', true);
}
#! /bin/sh
### BEGIN INIT INFO
# Provides: varnishncsa
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start HTTP accelerator log daemon
# Description: This script provides logging for varnish
#!/bin/bash
#
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04)
# Add Google Chrome's repo to sources.list
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source: http://www.google.com/linuxrepositories/)
@jmara
jmara / gist:ed4c874134f5c9b1c5b8
Last active August 29, 2015 14:15
ohai on XenServer 6.5
[2015-02-18T18:17:01+01:00] DEBUG: Plugin Ruby threw #<TypeError: can't convert nil into String>
[2015-02-18T18:17:01+01:00] DEBUG: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-7.4.1/lib/ohai/plugins/ruby.rb:70:in `join'
[2015-02-18T18:17:01+01:00] DEBUG: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-7.4.1/lib/ohai/plugins/ruby.rb:70:in `block (3 levels) in <main>'
[2015-02-18T18:17:01+01:00] DEBUG: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-7.4.1/lib/ohai/plugins/ruby.rb:68:in `map'
[2015-02-18T18:17:01+01:00] DEBUG: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-7.4.1/lib/ohai/plugins/ruby.rb:68:in `block (2 levels) in <main>'
[2015-02-18T18:17:01+01:00] DEBUG: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-7.4.1/lib/ohai/dsl/plugin/versionvii.rb:90:in `instance_eval'
[2015-02-18T18:17:01+01:00] DEBUG: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-7.4.1/lib/ohai/dsl/plugin/versionvii.rb:90:in `run_plugin'
[2015-02-18T18:17:01+01:00] DEBUG: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai
@jmara
jmara / gist:530d2e789e74dddffc90
Last active August 29, 2015 14:14
jenkins-cli
import sys
from jenkinsapi.jenkins import Jenkins
# Requirement: https://github.com/salimfadhley/jenkinsapi
# pip install jenkinsapi
if len(sys.argv) == 1:
print "Usage: %s Jenkins-URL" % sys.argv[0]
exit(1)