Skip to content

Instantly share code, notes, and snippets.

@jumanjiman
jumanjiman / lookup_arin.sh
Created February 12, 2014 18:46
find out who "owns" an ip
#!/bin/bash
# synopsis: ./lookup_arin.sh <ip-to-lookup> <output-file>
# parse command-line, but fall back to default values
ip=${1:-74.120.84.62}
outfile=${2:-/tmp/lookup_arin.out}
tmpfile=/tmp/$ip.raw
# parse raw data
@jumanjiman
jumanjiman / blah
Last active August 29, 2015 13:57
read ip from output file of hponcfg
<!-- HPONCFG VERSION = "4.3.0" -->
<!-- Generated 3/6/2014 15:4:58 -->
<RIBCL VERSION="2.1">
<LOGIN USER_LOGIN="Administrator" PASSWORD="password">
<DIR_INFO MODE="write">
<MOD_DIR_CONFIG>
<DIR_AUTHENTICATION_ENABLED VALUE = "N"/>
<DIR_LOCAL_USER_ACCT VALUE = "Y"/>
<DIR_SERVER_ADDRESS VALUE = ""/>
<DIR_SERVER_PORT VALUE = "636"/>

Keybase proof

I hereby claim:

  • I am jumanjiman on github.
  • I am jumanjiman (https://keybase.io/jumanjiman) on keybase.
  • I have a public key whose fingerprint is 9FCD 849B 8363 BAB9 6D8F 3DDC 7749 19C3 3CA0 083E

To claim this, I am signing this object:

@jumanjiman
jumanjiman / docker-limits.sh
Created May 25, 2014 13:21
memory limits in docker containers
#!/bin/bash
# Demonstrate memory resource limits in docker
# See also http://stackoverflow.com/a/20111960
function demo() {
mem=$1
echo "Run a container and limit to $mem"
cid=$(docker run -d -m $mem busybox /bin/sh -c "tail -f /var/log/*")
@jumanjiman
jumanjiman / blah.rb
Last active August 29, 2015 14:05
meta
class Blah
def table
{
:dword => :read_dword,
:string => :read_string,
}
end
def read_string(a_key)
puts 'string'
# Set the basic credencials
#
set imap_user= 'gmailUser@gmail.com'
set imap_pass= 'password'
set hostname = "gmail.com"
set realname = "gmailUser"
# Set GMAIL specific folders likem sent mail, drafts, All mail
set spoolfile = "imaps://imap.gmail.com/INBOX"
set folder = "imaps://imap.gmail.com/"
@jumanjiman
jumanjiman / flexlm-server.spec
Created October 29, 2011 19:59
spec file for flex license server
# do nothing instead of strip symbols
%global __strip /bin/true
# do not build debuginfo pkg
%global debug_package %{nil}
Name: flexlm-server
Summary: Intel floating license server
@jumanjiman
jumanjiman / xfce.pp
Created October 30, 2011 16:54
package list to use xfce on fedora
###################################################
# usage:
# include either xfce::enabled or xfce::disabled
# in your node definition
###################################################
class xfce::enabled {
$xfce_version = 'latest'
include xfce
}
@jumanjiman
jumanjiman / intel-license.spec
Created October 30, 2011 18:02
spec file to bundle an intel license file
Name: intel-license
Version: 0.1
Release: 1%{?dist}
Summary: Provides license file for Intel products
Group: System Environment/Base
License: Proprietary
URL: http://jumanjiman.github.com
Source0: %{name}-%{version}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
@jumanjiman
jumanjiman / boot-time-status.sh
Created November 4, 2011 22:28
kind of like chkconfig --list
#!/bin/bash
for i in /lib/systemd/system/*.service; do
svc=$(basename $i)
systemctl is-enabled $svc &> /dev/null && status=on || status=off
printf "%-50s %9s\n" $svc $status
done