Skip to content

Instantly share code, notes, and snippets.

$ ip a show usben0
7: usben0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:e0:4c:53:44:58 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.16/24 brd 192.168.1.255 scope global usben0
valid_lft forever preferred_lft forever
inet6 fe80::2e0:4cff:fe53:4458/64 scope link
valid_lft forever preferred_lft forever
$ ip route
default via 192.168.2.254 dev wlp1s0 proto static metric 600
@anddam
anddam / tcpdump.log
Created April 29, 2018 08:04
Tcpdump of an AP directly connected Ethernet
$ sudo tcpdump -v -i enx00e04c534458
tcpdump: listening on enx00e04c534458, link-type EN10MB (Ethernet), capture size 262144 bytes
09:41:32.774123 ARP, Ethernet (len 6), IPv4 (len 4), Reply 192.168.1.16 is-at 00:e0:4c:53:44:58 (oui Unknown), length 28
09:41:32.779891 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 40, options (RA))
192.168.1.16 > 224.0.0.22: igmp v3 report, 1 group record(s) [gaddr 224.0.0.251 to_ex, 0 source(s)]
09:41:32.779921 IP6 (hlim 1, next-header Options (0) payload length: 36) :: > ff02::16: HBH (rtalert: 0x0000) (padn) [icmp6 sum ok] ICMP6, multicast listener report v2, 1 group record(s) [gaddr ff02::1:ff56:2746 to_ex, 0 source(s)]
09:41:32.870634 IP (tos 0x0, ttl 255, id 56696, offset 0, flags [DF], proto UDP (17), length 186)
192.168.1.16.mdns > 224.0.0.251.mdns: 0 [10q] PTR (QM)? _ipps._tcp.local. PTR (QM)? _nmea-0183._tcp.local. PTR (QM)? _ftp._tcp.local. PTR (QM)? _webdav._tcp.local. PTR (QM)? _webdavs._tcp.local. PTR (QM)? _sftp-ssh._tcp.local.
Mar 18 17:24:47 MacBook-Pro-2 osinstallersetupd[601]: No available package ref for compatibility update. Ignoring.
Mar 18 17:24:47 MacBook-Pro-2 osinstallersetupd[601]: Using product <OSISPredicateUpdateInstallerProduct: 0x7fcafac58100> at distance 25
Mar 18 17:24:47 MacBook-Pro-2 osinstallersetupd[601]: Required package references: (
"<PKDistributionPackageReference com.apple.pkg.Core>",
"<PKDistributionPackageReference com.apple.pkg.EmbeddedOSFirmware>",
"<PKDistributionPackageReference com.apple.pkg.BridgeOSUpdateCustomer>",
"<PKDistributionPackageReference com.apple.pkg.BridgeOSBrain>",
"{\n Identifier = \"com.apple.dmg.BaseSystem\";\n MD5 = \"\";\n Size = 0;\n URL = \"BaseSystem.dmg\";\n Version = \"10.13.3.0.0.1516347890\";\n}",
"{\n Identifier = \"com.apple.chunklist.BaseSystem\";\n MD5 = \"\";\n Size = 4096;\n URL = \"BaseSystem.chunklist\";\n Version = \"10.13.3.0.0.1516347890\";\n}",
"{\n Identifier = \"com.apple.dmg.AppleDiagnostic
@anddam
anddam / installer.log
Created March 18, 2018 16:26
Failing Sierra install on MBP
Mar 18 07:52:06 MacBook-Pro-2 osinstallersetupd[582]: Got chunk 478 of 478
Mar 18 07:52:06 MacBook-Pro-2 osinstallersetupd[582]: No native mechanism to verify InstallESD.dmg
Mar 18 07:52:06 MacBook-Pro-2 osinstallersetupd[582]: Retrieved package com.apple.dmg.MacOSX (http-chunked://osrecovery.apple.com/::://oscdn.apple.com/content/downloads/30/62/091-11210/6w8r2mgu8054xbbs1hg5y6d4jc4524mkhx/OSInstaller/InstallESD.chunklist::://oscdn.apple.com/content/downloads/30/62/091-11210/6w8r2mgu8054xbbs1hg5y6d4jc4524mkhx/OSInstaller/InstallESD.dmg)
Mar 18 07:52:06 MacBook-Pro-2 osinstallersetupd[582]: Skipping preflighting firmware since we're booted into the Recovery OS
Mar 18 07:52:06 MacBook-Pro-2 osinstallersetupd[582]: Operation queue succeeded
Mar 18 07:52:06 MacBook-Pro-2 powerd[152]: Assertion Released. Type:NoIdleSleepAssertion Name:'OSInstaller Setup' Id:0x10000804b Process:osinstallersetupd [System: DeclUser kDisp]
Mar 18 07:52:06 MacBook-Pro-2 InstallAssistant[581]: Finished operation queue
Mar 18 07:52:07 M
@anddam
anddam / README.md
Created March 15, 2018 10:15
Windows conhost mapping between registry entries and concfg labels

Concfg works with JSON config files. Zenburn has been ported to Windows' conhost 1 with a registry file whose entries have "silent" names.

By applying the registry to a running system and then exporting the current configuration with concfg we're able to figure the mapping between registry entries and ANSI colors in conhost so we have a zenburn concfg preset.

#!/bin/python3
import sys
from collections import Counter
n = int(input().strip())
arr = [int(arr_temp) for arr_temp in input().strip().split(' ')]
length, counter = len(arr), Counter(arr)
:/home$ appcenter
** (process:2052): ERROR **: Client.vala:85: Metadata files have errors: /var/lib/app-info/yaml/security.ubuntu.com_ubuntu_dists_xenial-security_multiverse_dep11_Components-amd64.yml.gz, /var/lib/app-info/yaml/security.ubuntu.com_ubuntu_dists_xenial-security_universe_dep11_Components-amd64.yml.gz, /var/lib/app-info/yaml/it.archive.ubuntu.com_ubuntu_dists_xenial-backports_multiverse_dep11_Components-amd64.yml.gz, /var/lib/app-info/yaml/it.archive.ubuntu.com_ubuntu_dists_xenial-backports_universe_dep11_Components-amd64.yml.gz, /var/lib/app-info/yaml/security.ubuntu.com_ubuntu_dists_xenial-security_main_dep11_Components-amd64.yml.gz, /var/lib/app-info/yaml/it.archive.ubuntu.com_ubuntu_dists_xenial-backports_main_dep11_Components-amd64.yml.gz, /var/lib/app-info/yaml/it.archive.ubuntu.com_ubuntu_dists_xenial-backports_restricted_dep11_Components-amd64.yml.gz, /var/lib/app-info/yaml/security.ubuntu.com_ubuntu_dists_xenial-security_restricted_dep11_Components-amd64.yml.gz, /var/lib/app-info/yaml/
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.conf import settings
class User(AbstractUser):
"""Custom user model for future extension"""
class BalanceType(models.Model):
$ sudo wipefs --force /dev/sda6
offset type
----------------------------------------------------------------
0x438 ext4 [filesystem]
LABEL: void-root
UUID: 0c50e049-c7cc-4b7d-b709-45c7c5bdef39
$ sudo wipefs /dev/sda6
offset type
----------------------------------------------------------------
0x438 ext4 [filesystem]
from django.conf.urls import url
from . import views
app_name = 'ratings'
urlpatterns = [
url(r'^index/$', views.EnquiryListView.as_view(), name='list'),
url(r'^detail/(?P<pk>[\d]+)/$', views.EnquiryDetailView.as_view(), name='detail'),
url(r'prepare/$', views.EnquiryCreatePrepareView.as_view(), name='prepare'),