Skip to content

Instantly share code, notes, and snippets.

Michael Zhilin mizhka

  • NetCracker
  • Moscow
Block or report user

Report or block mizhka

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View dhcpd.conf
# dhcpd.conf
# option definitions common to all supported networks...
option subnet-mask 255.255.255.0;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.20.0 netmask 255.255.255.0 {
range 192.168.20.2 192.168.20.40;
option domain-name-servers 192.168.20.1;
option routers 192.168.20.1;
@mizhka
mizhka / openconnect
Last active Aug 26, 2019
OpenConnect FreeBSD rc script
View openconnect
#!/bin/sh
# $Id$
#
# $FreeBSD$
#
# PROVIDE: openconnect
# REQUIRE: NETWORKING
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf to enable openconnect
View zfs.html
<html>
<!DOCTYPE html>
<meta charset="utf-8">
<!-- Load d3.js -->
<script src="https://d3js.org/d3.v4.js"></script>
<!-- Create a div where the graph will take place -->
<div id="my_dataviz"></div>
<script>
function humanFileSize(bytes, si) {
View gist:ed8f9fcad4165fd91afd1b34e668a0f2
# sw
etherswitch0: VLAN mode: DOT1Q
etherswitch0: Switch MAC address: 00:00:00:00:00:01
port0:
pvid: 1
flags=3<CPUPORT,STRIPTAG>
media: Ethernet 1000baseT <full-duplex>
status: active
port1:
pvid: 2
@mizhka
mizhka / sysctl-tunables
Created Jun 4, 2019
FreeBSD 13-GENERIC-CURRENT tunables
View sysctl-tunables
kern.maxproc: Maximum number of processes
kern.ngroups: Maximum number of supplemental groups a user can belong to
kern.ipc.shm_allow_removed: Enable/Disable attachment to attached segments marked for removal
kern.ipc.shm_use_phys: Enable/Disable locking of shared memory pages in core
kern.ipc.shmall: Maximum number of pages available for shared memory
kern.ipc.shmseg: Number of segments per process
kern.ipc.shmmni: Number of shared memory identifiers
kern.ipc.shmmin: Minimum shared memory segment size
kern.ipc.shmmax: Maximum shared memory segment size
kern.ipc.semaem: Adjust on exit max value
View gist:1256aed0aa535d318cb369407616293d
BUFFALO U-BOOT Ver 1.03
AP93 (ar7240) U-boot
sri
=====================================================================================================================================
TAP CALC (read_cnt=512)
----+--------------------------------------------------------------------------------------------------------------------------------
TAP | 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
----+--------------------------------------------------------------------------------------------------------------------------------
FAIL| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 512 512 512 512 512 512 512 512 512 512 51
View gist:9098edbcc555a3e5fc0fe3b594160155
GOOD:
ar7240> erase 0xbf040000 +0x160000
Erase Flash from 0xbf040000 to 0xbf19ffff in Bank # 1
First 0x40 last 0x19f sector size 0x1000
400
Erased 352 sectors
ar7240> cp.b 0x81000000 0xbf040000 0x160000
Copy to Flash...
Copy 1441792 byte to Flash... write addr: bf040000
@mizhka
mizhka / gist:0e1461c360b133d526ebe0854635cf44
Created May 20, 2019
WHR-300 FreeBSD firmware - entropy
View gist:0e1461c360b133d526ebe0854635cf44
% binwalk -E whr300-tftp-noheader.bin
WARNING: Failed to import pyqtgraph module, visual entropy graphing will be disabled
DECIMAL HEXADECIMAL ENTROPY
--------------------------------------------------------------------------------
0 0x0 Rising entropy edge (0.985684)
1392640 0x154000 Falling entropy edge (0.000000)
1443840 0x160800 Rising entropy edge (0.989380)
3745792 0x392800 Falling entropy edge (0.693819)
View gist:f497f8ca7121087577d94d5b10d7f3d7
dig, host - fetches DNS information
fuser - displays the PIDs of processes using the specified files or file systems.
gcore - generate a core file of a running program
gdb - allow you to see what is going on ''inside'' another program / coredump
iotop - watches I/O usage information output and displays a table of current I/O usage by processes or threads on the system
lftp - a file transfer program that allows sophisticated ftp, http and other connections to other hosts (including parallel transfer)
lsof - lists on its standard output file information about files opened by processes
nc - networking utility for reading from and writing to network connections using TCP or UDP
nmon - a huge amount of important performance information in one go
pbzip2 - a parallel implementation of the bzip2 block-sorting file compressor that uses pthreads and achieves near-linear speedup on SMP machines
@mizhka
mizhka / gist:d26481c21ceaab93516ad73842ce70b6
Created May 14, 2019
Poor Man FreeBSD DDB stacktraces
View gist:d26481c21ceaab93516ad73842ce70b6
CODE:
int debug = 1;
sysctlbyname("debug.kdb.enter", NULL, NULL, &debug, sizeof(debug));
WHERE:
libc - abort
login - bail
You can’t perform that action at this time.