Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View sukhodolin's full-sized avatar

Eugene Sukhodolin sukhodolin

View GitHub Profile
find . -not -path '*/\.*' -type f -perm +a+x -exec chmod -x {} \;
import sys
fin = open(sys.argv[1], 'rb')
fout = open(sys.argv[1] + '.decrypted', 'wb')
fin.seek(256)
dataEnc = fin.read()
key = -1
for b in range(0, 256):
@sukhodolin
sukhodolin / ChangeAdapterState.vbs
Created September 21, 2015 00:56
Reset Network Adapter if connectivity is lost
If WScript.Arguments.Count = 2 Then
Adapter = WScript.Arguments.Item(0)
Action = WScript.Arguments.Item(1)
Else
Wscript.Echo "Usage: ChangeAdapterState.vbs AdapterName (Enable|Disable)"
Wscript.Quit
End If
Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter")
@sukhodolin
sukhodolin / DecodeCTX1.hs
Last active September 21, 2015 01:09
Decode CTX1 encoding
module Main where
import Data.Char
import Data.Word
import Data.Bits
import qualified Data.Text as T
import qualified Data.Text.Encoding as E
import Data.ByteString as B
import Data.ByteString.Char8 as BC
-- One more solution for
-- http://www.haskell.org/haskellwiki/99_questions/Solutions/7
-- that works for infinite input too (i.e. it's lazy in its input)
data NestedList a = Elem a | List [NestedList a]
get1st :: NestedList a -> (Maybe a, Maybe (NestedList a))
get1st (Elem e) = (Just e, Nothing)
get1st (List []) = (Nothing, Nothing)
get1st (List (l : ls)) = let (e, l') = get1st l