Skip to content

Instantly share code, notes, and snippets.

@joli80
joli80 / xls2csv.vbs
Created August 3, 2016 12:18
VB script for creating a csv file from an Excel file
Dim objFSO, currentDirectory, objFolder, colFiles
Set objFSO = CreateObject("scripting.filesystemobject")
currentDirectory = objFSO.GetAbsolutePathName(".")
Set objFolder = objFSO.GetFolder(currentDirectory)
Set colFiles = objFolder.Files
For Each objFile in colFiles
If UCase(objFSO.GetExtensionName(objFile.name)) = "XLSX" Or UCase(objFSO.GetExtensionName(objFile.name)) = "XLS" Then
Wscript.Echo "Exporting " & objFile.Name
Call Writefile(objFile.Path)
@joli80
joli80 / extract_IP_addresses.ps1
Last active November 2, 2016 20:33
Extract IP all addresses from a text file
# Credit to http://www.gfi.com/blog/windows-powershell-extracting-strings-using-regular-expressions/
$input_path = 'c:\ps\ip_addresses.txt'
$regex = '\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b'
select-string -Path $input_path -Pattern $regex -AllMatches | % { $_.Matches } | % { $_.Value }

Keybase proof

I hereby claim:

  • I am joli80 on github.
  • I am johanl (https://keybase.io/johanl) on keybase.
  • I have a public key whose fingerprint is 25A7 D648 1569 4C4E 5D32 E462 6074 2F9F 5E8C BC41

To claim this, I am signing this object:

@joli80
joli80 / dyndnsclient.c
Last active December 17, 2015 14:59
Simple Linux DynDNS update client
// Based on http://coding.debuntu.org/c-linux-socket-programming-tcp-simple-http-client
#include <stdio.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <netdb.h>
#include <string.h>
#include <sys/types.h>
#include <netinet/in.h>
Verifying that "johanlindqvist.id" is my Blockstack ID. https://explorer.blockstack.org/name/johanlindqvist.id