Posts tagged freebsd

freebsd: static bash

posted on 2015-12-29 07:43:55

To get a static bash executable which is always available, try this:

make -C /usr/ports/shells/bash -D WITH_STATIC_BASH -DWITHOUT_NLS PREFIX=/ install

rs232: vim not working over serial connection

posted on 2015-12-27 19:08:50

After having dd'd a fbsd image onto a micro sd card, attaching a monitor to the pi's hdmi port I could see... nothing. (On a sidenote: Go to the raspbsd site [here])http://raspbsd.org/) for a proper bsd image that works in a rbpi 2 B, none of the official images work. These are done by fbsd committer brd@)

Then some googling followed, discerning wether the hdmi-dvi adapter, the dvi-vga adapter or the kvm switch were responsible for that.

Result was, the HDMI port needs to be enabled. But by compiling the option into your OS image. (Ok, lets just skip that then...)

Since accessing the freebsd installation directly from the sd card was not a feasible solution, I hooked a UART / RS232 to USB adapter onto the rbpi pins. When wanting to edit the needed config files via vi, I could not see anything from the editor window.

Problem was, the TERM environment variable needs to be set properly.

Instead of TERM=dialup or something, set it to vt100.

In bash:

export TERM=vt100

In csh:

setenv TERM vt100

Mailing lists do help, but you need to read properly... found this answer here.

Network Stats on FreeBSD

posted on 2014-08-21 16:51:25

To see proper load and complete stats on a FreeBSD (i.e. a PFSense), use:

systat -ifstat 1

Which gives something like this:

                    /0   /1   /2   /3   /4   /5   /6   /7   /8   /9   /10
 Load Average

  Interface           Traffic               Peak                Total
     ovpns1  in      0.000 KB/s          1.714 KB/s           84.050 MB
             out     0.000 KB/s          3.965 KB/s          202.886 MB

        lo0  in      0.000 KB/s          0.000 KB/s          200.695 KB
             out     0.000 KB/s          0.000 KB/s          200.695 KB

       enc0  in      0.301 KB/s          0.618 KB/s          615.144 MB
             out     0.243 KB/s          0.483 KB/s          334.407 MB

        em2  in      0.095 KB/s          0.152 KB/s           28.847 MB
             out     0.095 KB/s          0.095 KB/s           28.016 MB

        em1  in    158.298 KB/s        206.448 KB/s          202.662 GB
             out    10.525 KB/s         71.434 KB/s           39.187 GB

        em0  in     11.428 KB/s         72.010 KB/s           41.853 GB
             out    49.342 KB/s         79.099 KB/s           88.548 GB

FreeBSD/PFSense via Grub2

posted on 2014-05-23 17:21:18

After installing PFSense (which is based on FreeBSD) on a dedicated machine for firewalling, a debian install was decided to be set up along with it. This should enable shorter setup times in case PFSense would not suffice: Just boot debian and fix the firewall via iptables in /etc/init.d/firewall.

Long story short, after the debian install and the grub, PFSense was lacking a boot entry. (Who would have guessed.)

Output of fdisk -l from within debian gave this:

Disk /dev/sja: 4011 MB, 4011614208 bytes
16 heads, 63 sectors/track, 7773 cylinders, total 7835184 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x90909090

    Device  Boot      Start         End      Blocks     Id  System
/dev/sda1     *          63     1639999      818968+    a5  FreeBSD
/dev/sda2           1638000     7835183     3098592     83  Linux

So the first partition has the PFSense on it.

Putting the lower part of this into /etc/grub.d/40_custom in debian did the trick:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "PFSense" {
    # discern partition name easiest via grub shell
    set root=(hd0,1)
    chainloader +1
    # instead of `chainloader +1`, this should work, too
    #kfreebsd /boot/loader
}

Do update-grub afterwards, reboot, and be done.

This blog covers .csv, .htaccess, .pfx, .vmx, /etc/crypttab, /etc/network/interfaces, /etc/sudoers, /proc, 10.04, 14.04, AS, ASA, ControlPanel, DS1054Z, GPT, HWR, Hyper-V, IPSEC, KVM, LSI, LVM, LXC, MBR, MTU, MegaCli, PHP, PKI, R, RAID, S.M.A.R.T., SNMP, SSD, SSL, TLS, TRIM, VEEAM, VMware, VServer, VirtualBox, Virtuozzo, XenServer, acpi, adaptec, algorithm, ansible, apache, apachebench, apple, applet, arcconf, arch, architecture, areca, arping, asa, asdm, autoconf, awk, backup, bandit, bar, bash, benchmarking, binding, bitrate, blackarmor, blockdev, blowfish, bochs, bond, bonding, booknotes, bootable, bsd, btrfs, buffer, c-states, cache, caching, ccl, centos, certificate, certtool, cgdisk, cheatsheet, chrome, chroot, cisco, clamav, cli, clp, clush, cluster, coleslaw, colorscheme, common lisp, configuration management, console, container, containers, controller, cron, cryptsetup, csync2, cu, cups, cygwin, d-states, database, date, db2, dcfldd, dcim, dd, debian, debug, debugger, debugging, decimal, desktop, df, dhclient, dhcp, diff, dig, display manager, dm-crypt, dmesg, dmidecode, dns, docker, dos, drivers, dtrace, dtrace4linux, du, dynamictracing, e2fsck, eBPF, ebook, efi, egrep, emacs, encoding, env, error, ess, esx, esxcli, esxi, ethtool, evil, expect, exportfs, factory reset, factory_reset, factoryreset, fail2ban, fbsd, fdisk, fedora, file, filesystem, find, fio, firewall, firmware, fish, flashrom, forensics, free, freebsd, freedos, fritzbox, fsck, fstrim, ftp, ftps, g-states, gentoo, ghostscript, git, git-filter-branch, github, gitolite, global, gnutls, gradle, grep, grml, grub, grub2, guacamole, hardware, haskell, hdd, hdparm, hellowor, hex, hexdump, history, howto, htop, htpasswd, http, httpd, https, i3, icmp, ifenslave, iftop, iis, imagemagick, imap, imaps, init, innoDB, innodb, inodes, intel, ioncube, ios, iostat, ip, iperf, iphone, ipmi, ipmitool, iproute2, ipsec, iptables, ipv6, irc, irssi, iw, iwconfig, iwlist, iwlwifi, jailbreak, jails, java, javascript, javaws, js, juniper, junit, kali, kde, kemp, kernel, keyremap, kill, kpartx, krypton, lacp, lamp, languages, ldap, ldapsearch, less, leviathan, liero, lightning, links, linux, linuxin3months, lisp, list, livedisk, lmctfy, loadbalancing, locale, log, logrotate, looback, loopback, losetup, lsblk, lsi, lsof, lsusb, lsyncd, luks, lvextend, lvm, lvm2, lvreduce, lxc, lxde, macbook, macro, magento, mailclient, mailing, mailq, manpages, markdown, mbr, mdadm, megacli, micro sd, microsoft, minicom, mkfs, mktemp, mod_pagespeed, mod_proxy, modbus, modprobe, mount, mouse, movement, mpstat, multitasking, myISAM, mysql, mysql 5.7, mysql workbench, mysqlcheck, mysqldump, nagios, nas, nat, nc, netfilter, networking, nfs, nginx, nmap, nocaps, nodejs, numberingsystem, numbers, od, onyx, opcode-cache, openVZ, openlierox, openssl, openvpn, openvswitch, openwrt, oracle linux, org-mode, os, oscilloscope, overview, parallel, parameter expansion, parted, partitioning, passwd, patch, pct, pdf, performance, pfsense, php, php7, phpmyadmin, pi, pidgin, pidstat, pins, pkill, plasma, plesk, plugin, posix, postfix, postfixadmin, postgres, postgresql, poudriere, powershell, preview, profiling, prompt, proxmox, ps, puppet, pv, pveam, pvecm, pvesm, pvresize, python, qemu, qemu-img, qm, qmrestore, quicklisp, quickshare, r, racktables, raid, raspberry pi, raspberrypi, raspbian, rbpi, rdp, redhat, redirect, registry, requirements, resize2fs, rewrite, rewrites, rhel, rigol, roccat, routing, rs0485, rs232, rsync, s-states, s_client, samba, sar, sata, sbcl, scite, scp, screen, scripting, seafile, seagate, security, sed, serial, serial port, setup, sftp, sg300, shell, shopware, shortcuts, showmount, signals, slattach, slip, slow-query-log, smbclient, snmpget, snmpwalk, software RAID, software raid, softwareraid, sophos, spacemacs, spam, specification, speedport, spi, sqlite, squid, ssd, ssh, ssh-add, sshd, ssl, stats, storage, strace, stronswan, su, submodules, subzone, sudo, sudoers, sup, swaks, swap, switch, switching, synaptics, synergy, sysfs, systemd, systemtap, tar, tcpdump, tcsh, tee, telnet, terminal, terminator, testdisk, testing, throughput, tmux, todo, tomcat, top, tput, trafficshaping, ttl, tuning, tunnel, tunneling, typo3, uboot, ubuntu, ubuntu 16.04, udev, uefi, ulimit, uname, unetbootin, unit testing, upstart, uptime, usb, usbstick, utf8, utm, utm 220, ux305, vcs, vgchange, vim, vimdiff, virtualbox, virtualization, visual studio code, vlan, vmstat, vmware, vnc, vncviewer, voltage, vpn, vsphere, vzdump, w, w701, wakeonlan, wargames, web, webdav, weechat, wget, whois, wicd, wifi, windowmanager, windows, wine, wireshark, wpa, wpa_passphrase, wpa_supplicant, x11vnc, x2x, xfce, xfreerdp, xmodem, xterm, xxd, yum, zones, zsh


Unless otherwise credited all material Creative Commons License by sjas