Skip to content

Instantly share code, notes, and snippets.

View bentwire's full-sized avatar

Mike Panetta bentwire

  • BentWire Industries
View GitHub Profile
@bentwire
bentwire / multistrap.py
Created March 13, 2020 16:19
libapt-pkg in chroot...
#!/usr/bin/python3
# This is an attempt to build a python work-alike of multistrap.
# It currently lacks many features
# Dependency selection ... is crap. Needs proper version selection
import apt
import os
import sys
import subprocess
[196131.233885] usb 3-1: new full-speed USB device number 12 using xhci_hcd
[196131.362802] usb 3-1: not running at top speed; connect to a high speed hub
[196131.363837] usb 3-1: config index 0 descriptor too short (expected 25, got 9)
[196131.363841] usb 3-1: config 1 has 0 interfaces, different from the descriptor's value: 1
[196132.596557] usb 3-1: string descriptor 0 read error: -32
[196132.596565] usb 3-1: New USB device found, idVendor=ffff, idProduct=ffff
[196132.596568] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
00000000 00 00 00 00 00 00 b0 3b 00 00 00 ba 00 00 c0 3b |.......;.......;|
<?xml version='1.0' encoding='utf-8'?>
<?grc format='1' created='3.7.10'?>
<flow_graph>
<timestamp>Fri Feb 3 22:01:38 2017</timestamp>
<block>
<key>options</key>
<param>
<key>author</key>
<value></value>
</param>
# -*- coding: utf-8 -*-
'''
Detect disks
'''
from __future__ import absolute_import
# Import python libs
import glob
import logging
import re
{-# LANGUAGE OverloadedStrings, ExtendedDefaultRules #-}
import System.Environment
import Database.MongoDB
import Data.Either
main :: IO ()
main = do
conn <- runIOE $ connect $ host "127.0.0.1"
walkDBs conn
{-# LANGUAGE OverloadedStrings, ExtendedDefaultRules #-}
import System.Environment
import Database.MongoDB
import Data.Either
main :: IO ()
main = do
conn <- runIOE $ connect $ host "127.0.0.1"
testCollections <- access conn master "test" allCollections
main.hs:11:20:
Couldn't match expected type `[Either a0 ()]'
with actual type `Either Failure [Collection]'
In the first argument of `rights', namely `testCollections'
In the second argument of `($)', namely `rights testCollections'
In a stmt of a 'do' block: print $ rights testCollections