Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am debussyman on github.
  • I am debussyman (https://keybase.io/debussyman) on keybase.
  • I have a public key ASDkWvf891GmeZRGaT1ImF5Jy6cUg0wLpf9rQo2gI0S0Ogo

To claim this, I am signing this object:

@debussyman
debussyman / DeleteOldStuff
Created September 11, 2014 18:41
Delete file or folders that are modified in the past
find [/some/path] -mtime +[NumDays] [-type f] -exec rm -[r]f {} \;

Two ways to do it, but only worked for me so I'll put it first and the second for reference:

$ openssl pkcs12 -export -in hostname.crt -inkey hsotname.key -out hostname.p12
$ openssl pkcs12 -in hostname.p12 -nodes -out hostname.pem

Other options for this method in comments below:

# Note, the -certfile root.crt appends all CA certs to the export, I've never needed these so it's optional for my personal steps
$ openssl pkcs12 -export -in hostname.crt -inkey hsotname.key -certfile root.crt -out hostname.p12

Note, I've always had my hostname.crt as part of my .pem, so I keep my certs but apparently you may not have to, hence the nocerts flag being an extra option in this sample

@debussyman
debussyman / gist:8640039
Created January 26, 2014 22:04
Card CSS
.box h3{
text-align:center;
position:relative;
top:80px;
}
.box {
width:70%;
height:200px;
background:#FFF;
margin:40px auto;
@debussyman
debussyman / gfind
Last active December 30, 2015 07:39
Simple script that wraps grep recursive find
#!/bin/bash
export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'
function usage
{
echo "usage: gfind \"search string\" [-e file extension ]"
}
filetype=
# http://wiki.apache.org/solr/FAQ#How_can_I_delete_all_documents_from_my_index.3F
# http://wiki.apache.org/solr/UpdateXmlMessages#Updating_a_Data_Record_via_curl
curl http://HOST:PORT/solr/update?commit=true -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'