Skip to content

Instantly share code, notes, and snippets.

View coolya's full-sized avatar

Kolja Dummann coolya

View GitHub Profile
traceroute opscode-omnibus-packages.s3.amazonaws.com [17:25:42]
traceroute to s3-1-w.amazonaws.com (54.231.1.217), 64 hops max, 52 byte packets
1 192.168.1.1 (192.168.1.1) 1.110 ms 0.935 ms 0.755 ms
2 87.186.224.48 (87.186.224.48) 21.486 ms 22.678 ms 21.190 ms
3 217.0.75.106 (217.0.75.106) 22.370 ms 88.930 ms 140.463 ms
4 f-ed4-i.f.de.net.dtag.de (62.154.15.10) 24.636 ms 25.471 ms 135.240 ms
5 80.156.161.46 (80.156.161.46) 25.866 ms 25.925 ms 135.329 ms
6 ae-6.r20.frnkge04.de.bb.gin.ntt.net (129.250.6.248) 24.870 ms 124.842 ms
ae-1.r21.frnkge03.de.bb.gin.ntt.net (129.250.6.216) 33.385 ms
7 ae-3.r23.nycmny01.us.bb.gin.ntt.net (129.250.3.180) 111.264 ms
wget https://opscode-omnibus-packages.s3.amazonaws.com/debian/6/x86_64/chef_11.16.4-1_amd64.deb [17:22:03]
--2014-10-24 17:22:04-- https://opscode-omnibus-packages.s3.amazonaws.com/debian/6/x86_64/chef_11.16.4-1_amd64.deb
Resolving opscode-omnibus-packages.s3.amazonaws.com... 54.231.16.25
Connecting to opscode-omnibus-packages.s3.amazonaws.com|54.231.16.25|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 31437864 (30M) [application/x-debian-package]
Saving to: 'chef_11.16.4-1_amd64.deb'
100%[======================================================================================================================================================================================================================================>] 31,437,864 2.27MB/s in 21s
@coolya
coolya / gist:1fccef3591086bd7ba7d
Last active August 29, 2015 14:04
High Performance Loggin
using logv.http;
using logv.ws.core;
using System;
using System.Collections.Concurrent;
using System.Threading.Tasks;
using MongoDB.Bson;
using logv.ws.core.data;
namespace logv.host
{
@coolya
coolya / check notification permission
Last active September 10, 2020 02:43
How to check if you app has permission to get notification service listener
boolean hasNotificationAccess()
{
ContentResolver contentResolver = this.getContentResolver();
String enabledNotificationListeners = Settings.Secure.getString(contentResolver, "enabled_notification_listeners");
String packageName = this.getPackageName();
// check to see if the enabledNotificationListeners String contains our package name
return !(enabledNotificationListeners == null || !enabledNotificationListeners.contains(packageName));
}
struct DataStructures_Trackpoint (*foo)(struct DataStructures_Trackpoint);
if ( !((*foo)(i1).alt == 100) )
{
(*__failures)++;;
printf("$$FAILED: ***FAILED*** (");
printf("testID=%i",0);
printf(") @FunctionPointers:testLambdaProcessing:0#6864902200221979870\n");
}
@coolya
coolya / gist:3621884
Created September 4, 2012 14:48
Objectgraph
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Text;
namespace ConsoleApplication1
{
class Program
@coolya
coolya / gist:3551118
Created August 31, 2012 10:13
EnumerableExtensions.cs
public static class EnumerableExtensions
{
public static BlockingCollection<T> CopyToBlockingCollectionAsync<T>(this IEnumerable<T> source)
{
var collection = new BlockingCollection<T>();
Task.Factory.StartNew(() =>
{
foreach (var item in source)
{
@coolya
coolya / gist:2953039
Created June 19, 2012 08:36
Convert number to a higher base
x= 2547, y = 8, x * 10 ^ ((y - 1) - (int(log10(x)))
class GenricCmdLineParser
{
private Dictionary<string, Action<string>> Entries = new Dictionary<string, Action<string>>();
protected void Register(string arg, Action<string> valueSetter)
{
if (!Entries.ContainsKey(arg))
Entries.Add(arg.ToLowerInvariant(), valueSetter);
}
var config = new IConfiguration() {Path = "meh", Root = "foo" }; // where IConfiguration is a Interface