apt-get update
apt-get install -y zlib1g-dev libncurses5-dev ghc cabal-install happy alex
cabal update
cabal install cabal-install
export PATH=$HOME/.cabal/bin:./.cabal-sandbox/bin:$PATH
// $ 6g echo.go && 6l -o echo echo.6 | |
// $ ./echo | |
// | |
// ~ in another terminal ~ | |
// | |
// $ nc localhost 3540 | |
package main | |
import ( |
module External where | |
import Language.Haskell.TH.Syntax | |
import Language.Haskell.TH.Lib | |
loadStringFromFile :: Q Exp | |
loadStringFromFile = do | |
let externalDependency = "external.txt" | |
qAddDependentFile externalDependency | |
s <- qRunIO $ readFile externalDependency |
{-# LANGUAGE OverloadedStrings, DeriveDataTypeable, NoMonomorphismRestriction #-} | |
module AesonTest where | |
import qualified Data.Aeson.Generic as A | |
import qualified Data.ByteString.Lazy as L8 | |
import Data.Data | |
import Data.Typeable | |
import Codec.Binary.UTF8.String as U8 | |
import Data.Maybe |
$ ssh-keygen -l -f /path/to/keys/id_rsa.pub | |
2048 aa:bb:cc:dd:ee:ff:00:11:22:33:44:55:66:77:88:99 id_rsa.pub (RSA) |
import Control.Monad.Reader | |
hello :: Reader String String | |
hello = do | |
name <- ask | |
return ("hello, " ++ name ++ "!") | |
bye :: Reader String String | |
bye = do | |
name <- ask |
{-# LANGUAGE TemplateHaskell #-} | |
-- An example of testing TH-generated thingadoohickies. | |
-- | |
-- Using the standard QuickCheck module, there is no direct way to test | |
-- values generated with Template Haskell functions, most of which end up | |
-- in the Q monad. This little writeup describes how to test those values | |
-- using the module Test.QuickCheck.Monadic. | |
-- | |
-- For this example, you can ignore the doohickies being generated. I just |
I’m a web app that wants to allow other web apps access to my users’ information, but I want to ensure that the user says it’s ok.
I can’t trust the other web apps, so I must interact with my users directly. I’ll let them know that the other app is trying to get their info, and ask whether they want to grant that permission. Oauth defines a way to initiate that permission verification from the other app’s site so that the user experience is smooth. If the user grants permission, I issue an AuthToken to the other app which it can use to make requests for that user's info.
Oauth2 has nothing to do with encryption -- it relies upon SSL to keep things (like the client app’s shared_secret) secure.
1) Download cntlm rpm package from http://sourceforge.net/projects/cntlm/files/cntlm/ | |
2) Login as root | |
3) Run command: | |
$ rpm -ivh cntlm-*.rpm | |
4a) Obtain password hash for the configuration file in step 4b (do not put plaintext password in configuration) | |
$ cntlm -H -d <domain> -u <username> |
package main | |
import ( | |
"bytes" | |
"encoding/binary" | |
"fmt" | |
"log" | |
"os" | |
) |