This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Blog post: https://web.archive.org/web/20080308103645/http://blogs.sun.com/andreas/entry/no_more_unable_to_find | |
// Code found at https://web.archive.org/web/20080308103645/http://blogs.sun.com/andreas/resource/InstallCert.java | |
/* | |
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* | |
* - Redistributions of source code must retain the above copyright |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%define rubyver 2.2.0 | |
%define debug_package %{nil} | |
Name: ruby | |
Version: %{rubyver} | |
Release: 1%{?dist} | |
License: Ruby License/GPL - see COPYING | |
URL: http://www.ruby-lang.org/ | |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) | |
BuildRequires: readline-devel ncurses-devel gdbm-devel glibc-devel tcl-devel unzip openssl-devel db4-devel byacc make libyaml-devel valgrind-devel gmp-devel clang |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# http://stackoverflow.com/a/9256709/31493 | |
trap_with_arg() { | |
func="$1" ; shift | |
for sig ; do | |
trap "$func $sig" "$sig" | |
done | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# show process start time for a give PID (GNU ps) | |
ps -o lstart= -p $PID | |
# show process start time for all processes (GNU ps) | |
ps ax -O lstart | |
# show process environment variables (BSD grep) | |
ps -Eww -p $PID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find ~/.m2/repository -name '*.jar' -exec sh -c "file {} | grep -q HTML && echo {}" \; | tee ~/broken-jars.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo route -n add 192.168.99 -interface vboxnet0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Delete all images in Slack that were uploaded until yesterday""" | |
import requests | |
import datetime | |
import sys | |
TOKEN = 'Put your Slack auth token here' | |
SLACK_API = 'https://slack.com/api' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo strace -p $PID -e trace=write -e write=1,2 | |
# To log started and elapsed times, add -ttT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[String] $remoteUrl, | |
[String] $localPath | |
) | |
$webClient = new-object System.Net.WebClient; | |
$webClient.DownloadFile($remoteUrl, $localPath); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://serverfault.com/a/426429/55687 | |
PRIVKEY=id_rsa | |
TESTKEY=id_rsa.pub | |
diff <( ssh-keygen -y -e -f "$PRIVKEY" ) <( ssh-keygen -y -e -f "$TESTKEY" ) |