-
polyex
it's counting binary files too
-
rwp
Do you have a file name pattern to restrict to?
-
rwp
If this is source code you might want to use sloccount instead anyway.
-
polyex
nope
-
rwp
find . -name '*.[chyl]' -exec wc -l {} +
-
rwp
find . \( -name '*.txt' -o -name '*.html' \) -exec wc -l {} +
-
rwp
Just examples...
-
rwp
How would you differentiate between files you wish to count and files you do not wish to count? If you can state the recipe then almost certainly it can be done.
-
polyex
just need a text type included and other types ignored
-
polyex
so using file cmd to detect type?
-
jaredj
sure, so find ... | xargs file, look at the output of that, see which ones you want
-
jaredj
then pipe it to more things to search for that pattern
-
polyex
sum the wc -l of the paths returned by find . -type f -exec file {} \; grep -E 'ASCII text|UTF-8 text'
-
jaredj
well, once you've got those file results, they each look like "/some/file/name: ASCII text" or so
-
jaredj
you need to peel off the colon and everything after it; cut(1) can do that
-
jaredj
(if you haven't encountered it before, "foo(1)" means foo is in section 1 of the manual; you can read that with "man 1 foo")
-
polyex
tried cut -f 1 -d ': ' but it said bad delimiter
-
jaredj
try -d:
-
jaredj
i think you only get to specify one character and ': ' is two characters
-
jaredj
or -d ':' without a space should do the same
-
polyex
cut -f 1 -d ':' worked
-
jaredj
hurrah! now you have just a list of filenames, right?
-
polyex
paths ya
-
polyex
recursive
-
jaredj
cool, so you can pipe it to xargs wc -l
-
polyex
it auto totals too, dang nice
-
jaredj
o/
-
polyex
full cmd is find . -type f -exec file {} \; | grep -E 'ASCII text|UTF-8' | cut -f 1 -d ':' | xargs wc -l
-
polyex
*seems* to work pretty flawlessly
-
polyex
can find any fault in it?
-
jaredj
if you have any filenames with spaces in them, that'll gum it up
-
jaredj
if you have any filenames with *colons* in them, that'll *really* gum it up :)
-
polyex
i don't but any way to fix that?
-
polyex
any easy way
-
jaredj
for spacessss -- ok so i never use find's -exec. there may be something that find by itself can do there
-
jaredj
but so usually i have a command like find [...] | xargs do_a_thing
-
jaredj
and if i turn it into find [...] -print0 | xargs -0 do_a_thing
-
jaredj
then that makes find output its filenames delimited by null characters instead of newlines, and it makes xargs expect that filenames will be separated by null characters instead of whitespace
-
jaredj
but when you run file on your filenames, it's not going to delimit *its* output with nulls, ... hmm
-
jaredj
WHAT
-
jaredj
file has a -0 switch
-
jaredj
but grep doesn't
-
jaredj
anyway, sometimes i end up tucking a perl -pe 's/\n/\0/g' or perl -pe 's/\0/\n/g' in my pipeline to translate back and forth between newlines and nulls as needed
-
jaredj
you might be able to do that more simply with tr or sed instead, but perl was the first thing i found that understood me when i said \0
-
zwr
jaredj: tr '\n' '\0'
-
jaredj
anyway. yeah one of the things i hate about *nix shell parameters/input/output is that the simplest way to say it can fail in some corner cases, and the safest way to say it lacks simplicity
-
jaredj
zwr: yeah figures lol
-
jaredj
zwr: today i learned a simpler way. thanks! :)
-
mns
Would it be easier to upgrade from 13.3Rp5 to 14.1R or go to 14.0R and then 14.1R ?
-
polyex
i always fresh upgrade between major versions just saying
-
polyex
fresh install, not upgrade
-
jaredj
mns i think i've gone from 13.x to 14.1. it worked for me
-
polyex
jaredj ty for help on line counter btw
-
jaredj
sure thing :)
-
mns
jaredj: thanks. that helps.
-
mns
polyex: I used to do that, once upon a time, when upgrade tools were not always stable (on linux, back around Red Hat 4 and Yellow Dog Linux/ppc). Once I switched to Debian and I could use apt-get to do upgrades, I don't think I've done fresh installs in the last 26+ years.
-
polyex
i'll try forever upgrades after pkgbase is default
-
mns
With FreeBSD I've always upgraded to the latest RELEASE version. Just this time around, for some reason, I didn't upgrade to 14.0 and now I'm behind, so just wanted to check-in.
-
mns
polyex: what's pkgbase?
-
jaredj
oohoohoo
-
jaredj
ok so base is ... i mean, you've got options like lib32, compilers, whatnot. but they all belong to a single build and whichever ones you have installed, you have to upgrade at upgrade time
-
mns
yes that's base. I thought pkgbase was something different, is it not?
-
jaredj
and unless you build your own (say, for example with Michael Dexter's occambsd), you have, like, the Mellanox Infiniband configuration tool in /usr/sbin, even if you don't need it.
-
jaredj
the idea of pkgbase is to package everything in base, and then be able to upgrade each thing as a package
-
jaredj
and maybe not have all the packages installed
-
polyex
ya modularize base into separate packages
-
jaredj
the effort has surged and flagged several times, i believe
-
jaredj
iXSystems was working on it, for example, before they moved most of their future efforts in a more Linuxly direction
-
jaredj
that was like five years ago
-
jaredj
afk
-
gh00p
So, I asked this last night but got no response before I (and my computer) fell asleep, `zfs unmount -f /j/s/web` gets me a "cannot unmount '/j/s/web': pool or dataset is busy". Is there a way to .. really force the umount? Or should I just reboot?
-
mns
gh00p: why not shutdown the process that is locking up the mount so that its a clean shutdown?
-
mns
jaredj: thanks for the explanation, that makes sense.
-
gh00p
Wups, I disconnected. Darn web client.
-
gh00p
mns, if I knew what process that was, I would. fstat doesn't report any use of that filesystem. The `-f` should unmount it anyway, despite blocking processes, but it does not.
-
unrealapex
hello i was wondering how i could change the default volume on my freebsd installation, whenever i boot up, the volume is at 86 and sadly i fail to notice that before listening to music and having my ear drums getting close to ruptured.
-
unrealapex
i have tried setting hw.snd.vpc_0db="20" in /etc/sysctl.conf however it does not seem to work
-
unrealapex
another question i have is how i can disable "natural scrolling" on my laptop's trackpad
-
rtprio
unrealapex: x or wayland?
-
unrealapex
xorg
-
rtprio
Option "NaturalScrolling" "false"
-
unrealapex
i tried putting this in /usr/local/etc/X11/xorg.conf.d/90-trackpad.conf, however, it looks like it's still enabled
0x0.st/XJGu.conf
-
nmz
just run mixer on crontabs @reboot
-
nmz
or whatever command to change the volume you use
-
unrealapex
would there be someday to do this in the kernel like i've tried or would using a crontab be a better way to go about this?
-
nmz
from what I know, running mixer should store the values
-
nmz
I'll see if /etc/rc.d/mixer has any clues
-
beanbrain
i'm trying to configure an nginx server inside a jail, and i think i'm completely lost
-
nmz
nope
-
unrealapex
why 86 out of every other possible value the maintainers could have set for the volume?
-
beanbrain
well, mostly lost. i have the jail running, but it can't access the internet from inside the jail
-
unrealapex
i feel like something around 40 would be more reasonable :/
-
nmz
I mean, mines at 100 and I can barely hear anything
-
nmz
you have a really good soundsystem
-
beanbrain
what parts of the configuration could be causing this issue? aside from the jail, i configured most of the server just following the handbook
-
beanbrain
(which is an excellent resource, btw, with the exception of the section on jails, which is out of date and incomplete)
-
unrealapex
I connected ear buds to my computer whichi was probably the issue :(
-
unrealapex
I'll write a crontab and see if that fixes this issue :)
-
nmz
I mean, you're writing the crontab because the issue can't be fixed :(
-
nmz
ah
-
nmz
unrealapex: sound.4
-
nmz
search part "To define default values for the different mixer channels, set the"
-
kevans
you could just write an /etc/rc.local to fix it
-
kevans
or hints, yeah, that makes sense
-
unrealapex
nmz: this is a man page correct?
-
nmz
yes
-
nmz
man sound
-
unrealapex
running sysctl hint.pcm.0.vol="0", i get "sysctl: unknown oid 'hint.pcm.0.vol'" i believe i inputted the correct oid
-
nmz
I think that's only for /boot/loader.conf
-
nmz
man device.hints
-
unrealapex
ah thanks for clarifying
-
unrealapex
do you mean /boot/device.hints?
-
unrealapex
oh
-
unrealapex
i see
-
nmz
sorry, never had to use device hints before
-
jmnbtslsQE
gh00p: did you check for any nullfs mounts
-
unrealapex
where do user configuration files go on freebsd? on linux directories would be either in $HOME or $XDG_CONFIG_DIR, should i do the same on freebsd or should i put config files in /usr/local/etc?
-
mane
unrealapex: normally user directories reside in /usr/home
-
remiliascarlet
unrealapex: You can just configure it to wherever you want under $HOME/.config/user-dirs.dirs.
-
remiliascarlet
But in principle, both $HOME or ~/.config should work on every Unix-like system.
-
vedranm
mane: not any longer since 14.0-RELEASE, they are now in /home
-
mane
i see
-
mane
-
polarian
I am struggling to get FreeBSD connecting to wifi, my phone can but my laptop cant unless I am closer to the AP... could just be a weaker antenna or the fact there is 10+ wifi networks in my area (everything is wifi enabled, tv's printers, all the neighbours routers etc) and this is on the 2.4GHz band because my laptop is IEEE 802.11n
-
polarian
anything I can do to try to improve connectivity?
-
regis
polarian: FreeBSD has barely working support for 5GHz and as for now, speeds limited to 80211n. Make sure your WiFi card is supported (mine in 3-years-old ThinkPad only started working on 15-CURRENT some 3 months ago) and don't expect speeds higher than what you get on 2.4GHz.
-
polarian
regis: it worked flawlessly until last night/today
-
polarian
also there is nothing wrong with 2.4GHz imo
-
polarian
in fact its much more stable than 5GHz which travels much shorter distances, not to mention 6GHz which almost requires a AP in every room as it can't go far...
-
polarian
imo wireless is just for connection on the go... 802.11n is fine for this... if you want high speed stick a ethernet cable in :P
-
Demosthenex
wires FTW
-
polarian
indeed.
-
Demosthenex
what do greybeard sysadmins and leet gamers have in common? no wireless!
-
vkarlsen
I want TP for my network
-
Demosthenex
i'm getting beavis flashbacks
-
vkarlsen
:)
-
yuripv
s/want/need/ then :D
-
remiliascarlet
Not a greybeard (simply because I can't grow one without getting a sex change perhaps), but I do have all my 10+ laptops on ethernet. No WiFi, unless I take them to some place else.
-
vkarlsen
You're a greybeard in spirit, remiliascarlet
-
remiliascarlet
I do play games though, but on a desktop, since all my laptops run a BSD OS.
-
remiliascarlet
1 is Free, 1 is Net, and all the others are Open.
-
remiliascarlet
I don't run Dragonfly, simply because I can't manage to successfully install it on real hardware for whatever reason.
-
Soni
what happens if you try to bind on ::ffff:0:0
-
Demosthenex
remiliascarlet: i may have the right hormones but a beard looks hideous on me. lets both be honorary beardless greybeads.
-
Demosthenex
i'd like to hereby announce the new FreeBSD Greybeards club, beard not required for membership. Only a disdain for stupid technology and a good "get off my lawn" attitude.
-
remiliascarlet
Soni: The whole universe would get sucked into a blackhole.
-
Soni
we don't wanna fire up the freebsd vm right now
-
regis
polarian: 2.4GHz is extremely polluted in residential areas, and in my case less stable than 5GHz due to noise from neighbors' devices. I'm really, really happy that my ThinkPad's AX200 card started working recently (the model was supported for a long time, since 14-CURRENT I think, but my specific device wasn't covered). I don't care about speeds that much as stability and I only got it with 5GHz living
-
regis
in an appartment complex.
-
polarian
apartment complexes are the worst for wireless pollution... I am in semi-detached so I have a couple of neighbours
-
polarian
but 5GHz band is saturated too now, most devices are dual band
-
polarian
the solution is a wifi ap in each room :P
-
polarian
or higher gain antenna :P
-
last1
is there a non-proxy solution that can route incoming packets through a private VPN/tunnel and come out the other end with their original IP addresses ?
-
polarian
last1: why would you want to preserve the IP address
-
last1
polarian: for logging purposes
-
regis
polarian: 5GHz has generally way shorter range than 2.4GHz and is less resistant to objects/walls etc. And it's great because your neighbors' f'in printer or fridge announcing their BSSID for whatever reasons, or "gaming WiFi routers" with "misconfigured" signal strength above regionally allowed and occupying multiple channels, are much less noisy even in adjacent appartments in an appartment complex. I
-
regis
don't work with WiFi for 19-20 years profesionally, and my modern knowledge of 802.11 comes from consumer / low-end-enterprise devices that "just work". But my consumer opinion is that 5GHz is more reliable due to less noise, given proper coverage and strong signal.
-
polarian
regis: but that also makes it unrealistic to use 5GHz in your own home... as you need APs everywhere
-
polarian
for a small house we need 3 AP mesh in order to reliably get 5GHz coverage... and even then due to congestion in the area it sometimes struggles to get a few mbps
-
regis
polarian: I have a rather small apartment and one Ubiqiti device covers it well.
-
jaredj
what? you now need more goods and services to get the same value? but that's marvellous! -- monopoly top hat capitalist dude
-
regis
I think it's 47m²
-
scoobybejesus
last1: makes me think of a site to site vpn, where you have routers on each end. natting twice. nat into the vpn, and nat back out. spreading a subnet over two locations. can get messy, right? you only want one dhcp server, but what if the two networks lose connection?
-
Soni
last1: IPv6?
-
regis
polarian: You're mentioning a "house" and "congestion in the area". Are you sure that you see 5GHz congestion and not mixing it with 2.4? I usually see 20+ 2.4GHz networks, and just a few 5GHz ones. Currently, sitting at home when people got back from work already (7pm local time) I see 19 2.4GHz networks and single 5GHz one - mine. My experience is the same when travelling.
-
last1
hmm, maybe I've been thinking this wrong
-
last1
is there an optimization for FreeBSD to deal with higher latencies
-
last1
for example, if I want to transfer data quickly from a a server that's 200ms away vs one that's 15ms away
-
last1
is there any setting that's likely to have a meaningful impact over the transfer speed ?
-
getz
Do you want faster transfers or a lower latency? Theres no magic switch afaik but maybe use udp instead of tcp?
-
schizophrenic
is there a way to change font for tty in freebsd?
-
last1
I can't get lower latency, it's physical distance
-
last1
I need to optimize around it
-
rwp
There are a series of patches to ssh to increase buffer windows and other things to improve performance on high latency networks. You could look for them and try them out.
-
getz
i use mosh over high latency connections and its pretty great
-
rwp
The maintainer of those discusses them periodically on the openssh-devel mailing list.
-
rwp
+1 for mosh on high latency links for interactive use
-
schizophrenic
freebsd used actual text mode so I guess it's not possible to change font in tty
-
schizophrenic
s/used/uses
-
rwp
It's not a streaming data copy protocol though. For that on high latency links one needs more buffers in flight. And parallel connections.
-
jaredj
schizophrenic: no i'm pretty sure it's possible
-
getz
pretty sure you can change the font of the tty i just cant remember the command
-
rwp
schizophrenic, I assumed you meant on the vt console. No?
-
schizophrenic
rwp: yeah, it's called vt here in freebsd
-
jaredj
looks loke vidfont(1)?
-
rwp
I don't know but I would start with "man vt" and see if there is information there on it.
-
getz
vidfont(1)
-
jaredj
(i started with man -k font)
-
getz
ah you beat me to it
-
jaredj
:)
-
getz
I had this hidpi screen and couldnt see anything on startup, used to have the whole command memorized
-
jaredj
mannn. slackware used to have the greatest console fonts
-
rwp
My problem on the vt console is not the displayed font so much as the keymap. I have been customizing one for me but haven't got it where I want it yet.
-
jaredj
getz lol yeah
-
getz
the old openbsd font was really nice
-
schizophrenic
wait I can't change font to Noto Sans
-
getz
you need a bitmap font
-
schizophrenic
it doesn't list it however I can see it in fc-list
-
schizophrenic
bitmap font :o
-
schizophrenic
so no emoji?
-
getz
i think so, i might be mistaken
-
jaredj
"The vtfontcvt utility reads source font files in either BDF or Unifont
-
jaredj
HEX format and outputs a file in one of the available output formats." -- vtfontcvt(8)
-
schizophrenic
wow I could convert ttf font into bitmap font
-
jaredj
yeah i'm kinda sad that robust, modern text rendering takes so much code and work in excess of what vt/wscons/etc allow
-
jaredj
course i'm not even trying to do right-to-left text, and if i can't see emojis in my terminal that's good if anything :)
-
schizophrenic
emojis are overrated
-
schizophrenic
just use bitmojis
-
schizophrenic
\0/
-
jaredj
the wider i see that text rendering gap is, the worse a job i know a real CRT terminal would do, if i ever managed to get one
-
getz
see if you can't get the gallant font it makes me happy whenever I open the tty
-
getz
it looks very SPARCy
-
jaredj
mmmmm
-
jaredj
whoo. i've found five gallants now none of which sounds like the one you are talking about
-
jaredj
hah! here's a font called Gallant whose glyphs are cross-stitch patterns
-
jaredj
fonts101.com/fonts/view/Serif/18408/Galant has just one 'l' in its name, but it's at least a serif font
-
getz
haha funny, I was trying to turn it into a ttf to use in emacs, got it working but didnt like the outcome :(
-
jaredj
the X misc 12x24 font gives me 65% of the good sparc vibes
-
ibs
When I dock my laptop with 14.1 I get no external mouse and keyboard. I have a built-in dock in a Lenovo screen. Where shall I start to dig?
-
maccampus
You ned to connect it twice. One cable USB-C (Tb-Video), another Ub-C or USB (USB functions)
-
ibs
maccampus: Really? An ordinary USB is enough for #2 one? Where can I read about the why's?
-
maccampus
it's because the 2 are sepperated uinside the Lenovo screen
-
maccampus
i have the same issue with my HP screen
-
ibs
Ok.. interesting. Will investigate further. Unexpected answer. :-)
-
maccampus
or Maybe the HW Engineers at Apple are just smarter
-
maccampus
and they can use one cable for all signals
-
ibs
The same with Linux..
-
maccampus
i don't think the OS matters
-
maccampus
maybe the bios does
-
ibs
But my bare metal works excellent with winblows and linux. Not FreeBSD though. Disclaimer: I asked here before entering the rabbit hole.
-
nmz
weird, it seems xf86 was the one crashing my freebsd
-
nmz
giving me page faults
-
ibs
Hmm, would I do better with a "real" docking station? I don't really love the thought of two usb-cables to dock.
-
jkli
hi all
-
jkli
I am new to freebsd and am trying to understand the usecasses where freebsd or a bsd derivate would be preferred over linux for web applications
-
jkli
are there any places where freebsd is prefered over linux?
-
plasma
well afaik it is used in hughe lets say clusters in for streaming business, as revers proxy and/or cache
-
plasma
for example
-
topcat001
As a desktop it mostly boils down to user prefs. For example I run both on different machines.
-
topcat001
Running Linux is "easier" due to better support/popularity but above a certain skill level it does not matter anymore
-
topcat001
I ran FreeBSD as my work computer for many years, but now we worship M$$$ so I had to switch to Ubuntu to satisfy Azure MDM enforcement (the alternative was Win11 :shivers:).
-
topcat001
On my supported desktops it is very fast and lightweight; only something like Arch/Gentoo can compete but FreeBSD is actually easier to set up than those.
-
jkli
how is the learning curve switching to freebsd for a linux user?
-
jkli
does it use roughly the same cli tools?
-
scoobybejesus
i like freebsd because of native zfs support and jails
-
jkli
I am considering using freebsd for a select few use cases, say as reverse proxy and file host, since it natively supports zfs
-
topcat001
The most noticeable change is that the official documentation is much more coherent. Avoid following random online guides.
-
topcat001
The system management tools are quite different, but TBH redhat vs Arch for example is like that as well.
-
jkli
can I run docker containers that were made for linux on freebsd?
-
scoobybejesus
through a vm, sure. or things like this continue progressing
github.com/samuelkarp/runj
-
jkli
well
-
jkli
seems freebsd uses jails
-
jkli
and avoids docker overall
-
jkli
does jails have similiar features to docker like creating isolated networks etc?
-
jkli
for web dev docker containers are kinda the standard, so what would replace docker in freebsd?
-
jkli
i havent looked in detail how jails in freebsd works
-
jkli
i see, so docker relies heavily on the linux kernel and namespaces and control groups and therefor cant easily be ported to bsd without a vm
-
nmz
it does not
-
nmz
everything is different
-
nmz
netflix uses freebsd, apparently its good for cache's and so on
-
nmz
the closest distro to freebsd is slackware/gentoo/void linux.
-
duncan
jkli: it is not so much avoiding docker, but that BSD jails do a similar thing (OS-level virtualisation)
-
duncan
the other difference would be that you can virtualise lots of differennt linux distributions, but there is only really one freeBSD
-
duncan
although you can run different userlands in jails, I guess that's fairly similar to different flavours of linux.
-
duncan
I guess in principle the docker tooling could be adapted so that it knows a thing or two about how to marshal jails.
-
nmz
-
nmz
is freebsd dying that they wanna get rust folks on it?
-
jkli
nmz freebsd users are very old and few
-
jkli
so yeah, it is dying
-
scoobybejesus
there's no reason to be scared of rust. good abstractions
-
duncan
it seems to have unusual momentum behind it
-
uskerine
hi, I asked in #freebsd-jails which seems more appropiate but there is not that many audience as in here. When configuring a new thick jail, what is the minimal IP configuration so you aassign a static IP in the same interface and network segment than the host? Thanks
-
uskerine
to provide more details, I set up the ip4.addr value which is listed in jls, but when I access the jail ifconfig shows all interfaces from the server without IP
-
topcat001
I you have freebsd and need to run docker for dev work, the easiest way is to virtualise Ubuntu server in behyve:
forums.freebsd.org/threads/how-to-i…stall-a-ubuntu-guest-in-bhyve.66767
-
topcat001
ubuntu runs pretty well. I don't usually use a gui but it is available as well
-
uskerine
just in case it helps someone else: interface and allow.raw_sockets was needed in jail.d .conf file
-
levitating
when using make in the ports collection
-
levitating
how do I regain the menu to select the parts to build
-
levitating
or better question, where is a list of make commands
-
rtprio
list of make commands in in `man ports`
-
rtprio
make config will show the menu
-
levitating
thank you!!
-
rtprio
👍
-
last1
I have syslogd listening on port 514 and I am logging to it from haproxy
-
last1
I can see the traffic going to it, for example: 18:32:37.809772 IP asia-relay.53386 > asia-relay.syslog: SYSLOG mail.info, length: 99
-
last1
that's from tcpdump
-
last1
but I have nothing in /var/log/maillog
-
last1
in /etc/syslogd.conf I have: mail.info /var/log/maillog
-
rtprio
from the same machine?
-
last1
yes
-
last1
I can see them quite clearly with tcpdump, for example: E.......⊙.~<22>Aug 21 18:39:45 haproxy[1070]: Connect from 127.0.0.1:33839 to 127.0.0.1:81
-
last1
but if I run syslogd with -d switch there's nothing
-
last1
I run it like this: syslogd -d -a localhost -b localhost -C -f /etc/syslog.conf
-
rtprio
why not let haproxy write to the log file
-
last1
I got it figured out, I had two services listening on port 514
-
rtprio
uh huh
-
last1
haproxy doesn't like to write directly to file because of some chroot stuff
-
rtprio
bah