Skip to content

Instantly share code, notes, and snippets.

View ashic's full-sized avatar

Ashic Mahtab ashic

View GitHub Profile
@ashic
ashic / gist:8973361
Last active August 29, 2015 13:56
WTF???
How are you Ashic Mahtab,
We are delighted to formally offer you an employment to work with us in our Company. We came across your resume at jobsite.co.uk.
The salary for position offered is 1500.00 GBP per month. The standard group benefit plans and fringe benefits will be covered. The job details will be provided to you with return e-mail.
Your working timetable will be Monday through Friday for 2-3 hours a day. Trial period - 30 working days from the day you apply.
Please report to HR Department at [email protected] if you agree to the specified terms and conditions.
# Enable TCP - Must be run from SQL powershell
$MachineObject = new-object ('Microsoft.SqlServer.Management.Smo.WMI.ManagedComputer') .
$ProtocolUri = "ManagedComputer[@Name='" + (get-item env:\computername).Value + "']/ServerInstance[@Name='MSSQLSERVER']/ServerProtocol"
$tcp = $MachineObject.getsmoobject($ProtocolUri + "[@Name='Tcp']")
Write-Host "TCP current => $tcp.IsEnabled" -ForegroundColor Green
$tcp.IsEnabled = $true
$tcp.alter()
@ashic
ashic / console.xml
Created March 2, 2014 21:27
Console 2 settings
<?xml version="1.0"?>
<settings>
<console change_refresh="10" refresh="100" rows="40" columns="160" buffer_rows="400" buffer_columns="0" shell="powershell.exe" init_dir="" start_hidden="0" save_size="0">
<colors>
<color id="0" r="176" g="216" b="255"/>
<color id="1" r="0" g="0" b="128"/>
<color id="2" r="0" g="128" b="0"/>
<color id="3" r="0" g="128" b="128"/>
<color id="4" r="128" g="0" b="0"/>
<color id="5" r="128" g="0" b="128"/>
#!/bin/bash
#wget http://s3.amazonaws.com/downloads.basho.com/riak/1.4/1.4.8/ubuntu/precise/riak_1.4.8-1_amd64.deb
#sudo dpkg -i riak_1.4.8-1_amd64.deb
#wget http://security.ubuntu.com/ubuntu/pool/main/c/curl/curl_7.22.0-3ubuntu4.7_amd64.deb
#sudo dpkg -i curl_7.22.0-3ubuntu4.7_amd64.deb
riak stop
rm -rf /var/lib/riak/ring/*
rm -rf /var/lib/riak/bitcask/*
@ashic
ashic / gist:10942208
Created April 16, 2014 23:29
CamelCasedJson
public class CamelCasedJsonAttribute : Attribute, IControllerConfiguration
{
public void Initialize(HttpControllerSettings controllerSettings,
HttpControllerDescriptor controllerDescriptor)
{
controllerSettings.Formatters.JsonFormatter
.SerializerSettings.ContractResolver =
new CamelCasePropertyNamesContractResolver();
}
}
@ashic
ashic / gist:5d831738732cf50d3b77
Created June 10, 2014 12:02
From framework to library...
public class VigilEngine
{
private readonly Beam _beam;
public VigilEngine(Beam beam)
{
_beam = beam;
Console.WriteLine("Creating engine. {0}", Thread.CurrentThread.ManagedThreadId);
while (true)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using dokimi.core;
using dokimi.core.dokimi.core.Specs.MessageBased;
using dokimi.core.Specs.MessageBased;
using dokimi.nunit;
using Infura;
namespace Syndication.Client.Http
{
public class CachingAdapter : HttpClientAdapter
{
readonly HttpClient client;
public CachingAdapter(ICacheStore cacheStore, string[] defaultVaryHeaders)
{
//http://msdn.microsoft.com/en-us/library/system.net.cache.requestcachelevel(v=vs.110).aspx
//http://blog.technovert.com/2013/01/httpclient-caching/
{
"TotalResults": 14,
"TotalPages": 3,
"Page": 1,
"_links": {
"self": {
"href": "/beers?page=1"
},
"next": {
"href": "/beers?page=2"
@ashic
ashic / gist:b5edc7cfdc85aa60b066
Created January 22, 2015 11:26
Rabbitmq receiver
class RmqReceiver(uname:String,
passwd: String,
vHost:String,
host:String,
qName:String,
topic:Option[String])
extends Receiver[Array[Byte]](StorageLevel.MEMORY_AND_DISK_2) with Logging {