This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
ole "github.com/go-ole/go-ole" | |
"github.com/go-ole/go-ole/oleutil" | |
) | |
func main() { |
This file contains hidden or 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/python | |
import struct, array, time, io, fcntl | |
I2C_SLAVE=0x0703 | |
# find with sudo i2cdetect -y 1 | |
HDC1008_ADDR = 0x40 | |
bus=1 | |
fr = io.open("/dev/i2c-"+str(bus), "rb", buffering=0) |
This file contains hidden or 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
package main | |
import ( | |
"log" | |
) | |
const ( | |
configRST = (1 << 15) | |
configHeat = (1 << 13) | |
) |
This file contains hidden or 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
select | |
'Year' = DATEPART(YEAR, log_date), | |
'Month' = DATEPART(MONTH, log_date), | |
'Day' = DATEPART(DAY, log_date), | |
'Hour' = DATEPART(HOUR, log_date), | |
'Entries' = count(*) | |
from | |
system_logging | |
where | |
log_level = 'Error' |
This file contains hidden or 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
package main | |
import ( | |
"crypto/rand" | |
"fmt" | |
) | |
func main() { | |
b := make([]byte, 16) |
This file contains hidden or 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
with fs | |
as | |
( | |
select database_id, type, size * 8.0 / 1024 size | |
from sys.master_files | |
) | |
select | |
name, | |
(select sum(size) from fs where type = 0 and fs.database_id = db.database_id) DataFileSizeMB, | |
(select sum(size) from fs where type = 1 and fs.database_id = db.database_id) LogFileSizeMB |
This file contains hidden or 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
package main | |
import ( | |
"bytes" | |
"code.google.com/p/portaudio-go/portaudio" | |
"encoding/binary" | |
"fmt" | |
"io" | |
"log" | |
"os" |
This file contains hidden or 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
grep --directories=recurse --files-without-match "class=\"row\"" --include "*.aspx" |
This file contains hidden or 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
@echo off | |
set InstallFolder="d:\services\centralconfig" | |
nssm install centralconfig %InstallFolder%\centralconfig_windows_amd64.exe | |
nssm set centralconfig AppParameters serve | |
nssm set centralconfig Description CentralConfig REST config service | |
nssm set centralconfig Start SERVICE_AUTO_START |
This file contains hidden or 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
public static class NLogExtensions | |
{ | |
/// <summary> | |
/// Logs the item with an associated requestid | |
/// </summary> | |
/// <param name="logger">The logger to use</param> | |
/// <param name="level">The log level to use</param> | |
/// <param name="objectToLog">The object to serialize</param> | |
/// <param name="message">The message to associate with the serialized object</param> | |
/// <param name="requestId">The requestid to associate with this item</param> |