Skip to content

Instantly share code, notes, and snippets.

View nielsvanderbeke's full-sized avatar

Niels Vanderbeke nielsvanderbeke

View GitHub Profile
@nielsvanderbeke
nielsvanderbeke / duplicate files
Last active December 24, 2015 21:19
Find duplicate files
# print them
find . -regex '.*([0-9])\..*'
# count them
find . -regex '.*([0-9])\..*' | wc -l
# delete them
find . -regex '.*([0-9])\..*' -delete
@nielsvanderbeke
nielsvanderbeke / java keystores
Created October 7, 2013 09:35
java keystore and certificate commands
What is in a keystore
=======================
keytool -list -v -keystore keystore-file.jks | less
=======================
show certificates website
=======================
openssl s_client -host internet.onprvp.fgov.be -port 443 -showcerts
=======================
@nielsvanderbeke
nielsvanderbeke / crontab syntax
Created October 7, 2013 09:40
crontab syntax
string meaning
------ -------
@reboot Run once, at startup.
@yearly Run once a year, "0 0 1 1 *".
@annually (same as @yearly)
@monthly Run once a month, "0 0 1 * *".
@weekly Run once a week, "0 0 * * 0".
@daily Run once a day, "0 0 * * *".
@midnight (same as @daily)
@hourly Run once an hour, "0 * * * *".
#Affiche le nombre de ligne
:set nu
#supprime des lignes dans un fichier
:debut,find
#Met le char # devant les 20 lignes suivantes, le ^ correspond au début de la ligne
:.,+20 s/^/#/
#reexcute la derniere commande tapée
@nielsvanderbeke
nielsvanderbeke / xmllint and weblogic config.xml parsing
Last active December 28, 2015 09:49
xmllint and weblogic config.xml parsing
one-liner
=======================
echo "cat //*[local-name()='domain']/*[local-name()='server']/*[local-name()='name']/text()"| xmllint --shell config.xml | grep -v "/ >" | grep -v " -------"
in shell mode
=======================
xmllint --shell config.xml
/ > setns x=http://xmlns.oracle.com/weblogic/domain
@nielsvanderbeke
nielsvanderbeke / bash.functions
Created November 21, 2013 08:49
bash functions cygwin config
#short cut to open file in gui notepad++
np ()
{
/cygdrive/c/Program\ Files/Notepad++/notepad++.exe $* &
}
#short cut to open gui winscp
winscp ()
{
# request.xml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wst="http://sensedia.com/repository/wstoolkit">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-1">
<wsse:Username>system</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">manager</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">DWk64SMfJ6RxHAKgPRGtPA==</wsse:Nonce>
<wsu:Created>2013-04-17T18:36:54.013Z</wsu:Created>
</wsse:UsernameToken>
@nielsvanderbeke
nielsvanderbeke / telemeter.sh
Created January 8, 2014 14:01
script to get your telenet isp usage
#!/bin/sh
######################################################################
# script telemeter.sh
# purpose Get internet usage indicator telenet using telemeter webservice
# author Niels Vanderbeke
# date 20140103
# parameters none
# changed at 20140103
# changed by Niels Vanderbeke
######################################################################
@nielsvanderbeke
nielsvanderbeke / getMealVoucherSaldo.sh
Created January 8, 2014 14:02
Get meal voucher saldo from monizze card
#!/bin/sh
######################################################################
# script getMealVoucherSaldo.sh
# purpose Get meal voucher saldo from monizze card
# author Niels Vanderbeke
# date 20140108
# parameters none
# changed at 20140108
# changed by Niels Vanderbeke
######################################################################
@nielsvanderbeke
nielsvanderbeke / v-test
Created January 9, 2014 07:39
v-test vreg curl
curl -sLe ';auto' -k -d 'email=niels.vanderbeke@gmail.com' -d "keuze=EA" -d "netbeheerdere=Imea" -d "netbeheerderg=Imea" -d "tarief=TV" -d "tarief2=VER" -d "postcode=2570" -d "zipcodeid=2823" -d "gezinsleden=2" -d "tariefdag=1600" -d "tariefnacht=1900" -d "verbruik=23000" -d "javascript:submitForm();" 'http://vtest.vreg.be/hh/resultaat.asp' > vreg.html