Skip to content

Instantly share code, notes, and snippets.

Avatar

Eugene Sukhodolin sukhodolin

View GitHub Profile
View Remove-execution-bit.sh
find . -not -path '*/\.*' -type f -perm +a+x -exec chmod -x {} \;
View HpcTraceDecrypt.py
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 Sep 21, 2015
Reset Network Adapter if connectivity is lost
View ChangeAdapterState.vbs
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 Sep 21, 2015
Decode CTX1 encoding
View DecodeCTX1.hs
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
View Problem7
-- 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
You can’t perform that action at this time.