1. 1

    Sounds like a good time to finally set up my bouncer. If only there were one that had good Emacs compatibility.

    1. 4

      I just run weechat on a server and connect to the weechat relay with weechat.el. There’s a few bugs in weechat.el (e.g. nicks go out of sync) and some things missing (e.g. nick list), but that’s a small price to pay for replacing another standalone app with emacs :)

      1.  

        I did this at the beginning but quickly switched over to ZNC because of bugs like that, the inability to have per-client history rollback, and other little details… I still use Weechat half the time on the client side though :) (I also use Textual on macOS, and Palaver on iOS).

      2. 1

        Znc is what I use with erc

        1. 1

          I’ve been trying to set this configuration up for half a year now, but I never get anything I’m satisfied with. The ZNC documentation is quite bad and confused, imo. And when I manage to set it up, even using ZNC.el it won’t work with IRCnet. Switching between multiple servers is another annoyance.

          But maybe I’ve just messed up somewhere.

        2.  

          I used to use znc, seemed to work just fine with ERC.

          Now I use weechat (a bit more features, nice Android app), again with ERC. There is weechat.el, but I prefer ERC (connecting to what weechat calls an “irc relay”, instead of using the weechat protocol). I use https://gist.github.com/unhammer/dc7d31a51dc1782fd1f5f93da12484fb as helpers to connect to multiple servers.

          1. 1

            Ive used znc with Circe, works great

            1. 1

              What did you find in Circe that made it better than ERC or Rcirc?

              1. 2

                In case it’s useful - I used to use ERC, and I switched to Circe long enough ago that I can’t exactly remember, but I think the issue was that I wanted to connect to both freenode and an internal IRC server at the same time, and ERC made that awkward or impossible to do. It may well have improved in the last 5 years though.

                1. 2

                  It was easy for me to setup and use so I stick with it. Never tried those other two

            1. 3

              update-motd seems like it could be useful if it only ever showed important messages (“Please update the xeyes package immediately to avoid the EYEFORK vulnerability, see http://forkbleed.panic for more information”). Showing clickbait will quickly make people immune to reading motd, missing the real messages.

              1. 1

                As a long-time Emacs and Magit user, I don’t use Magit to navigate the commit history, I just use git log on the command line (or git log --stat or git log -p or git flog, where 'flog' is aliased to 'log --all --decorate=short --pretty=oneline --graph'). For a single file, I tend to just git log [-p] -- src/thefile.c. I’ve tried the magit log, but I’m just more used to the shell for that.

                1. 3
                  • Graphical Linear Algebra, by Pawel Sobocinski. With online textbooks, I normally get distracted and then forget about them, but I love the writing style here – this one has me hooked.
                  • Sin egen herre, by Tore Rem – a biography of author Jens Bjørneboe. Didn’t really know the author before, don’t really feel like reading more of his stuff after getting to know about his life, but it is fascinating how many weird beliefs it is possible to acquire while still being seemingly quite smart.
                  • Worm, by Wildbow. Addictive fun.
                  1. 4

                    These vary pretty heavily in quality. Many seem to be missing proper quoting. Use with caution.

                    1. 4

                      Use bash with caution.

                      1. 1

                        Yeah, but its the same as any script you find online, don’t run it if you don’t understand it. The benefit here is that some of the better one are explained or corrected by other users.

                      1. 2
                        • Syncthing
                        • nginx httpd (just static home page)
                        • Subsonic
                        • weechat!
                        • backups of all the other machines (home-grown script using btrfs+LUKS with snapshots; one big usb disk at home and one at my parents house rotating; has so far saved us from deleting family photos many times)

                        I used to have Owncloud, but got sick of having to (re-)configure the same stuff every update, and Syncthing covered my file syncing needs, while I mostly use git+emacs org-mode for my calendar (and bbdb with Syncthing for contacts).

                        1. 5

                          For websites: Firefox Sync :-) Everything that isn’t a website or is important enough to have more than 3 copies (laptop, workstation, phone) lives in a keepass file, hosted on a nextcloud instance.

                          1. 2

                            Do note that Firefox Sync has a pretty nasty security flaw: your passwords are ultimately protected by your Firefox Account password — so you need to make sure that it’s a high entropy one (like 52ICsHuwrslpDl6fbjdvtv, not like correct horse battery staple). You also need to make sure that you never log into your Firefox Account online: Mozilla serve the login UI with JavaScript, which means that they can serve you malicious JavaScript which steals your password (this is worse than a malicious browser, because someone might actually notice a malicious browser executable, but the odds of detecting a single malicious serve of a JavaScript resource are pretty much nil).

                            I use pass, with git-remote-gcrypt to encrypt the pass repo itself (unfortunately, pass has a security flaw in that it doesn’t encrypt filenames).

                            1. 2

                              I’m pretty sure the password isn’t used directly but derived into a crypto key using PBKDF2 on the client.

                              1. 3

                                This does not protect you from physical access (if you ever let your computer unlocked). It took me 10 seconds to discover that firefox lets anyone see the plain password of every account.

                                https://i.imgur.com/lbxmMow.png

                                1. 3

                                  If you use a master password, you have to enter that to see the plain password in that dialog.

                                  1. 1

                                    That makes more sense.

                                  2. 2

                                    True! imho physical access should be countered with something else. Lockscreens, hard disk encryption etc.

                                    1. 1

                                      Yes, of course if there is a physical access there is no much hope left: even with ssh, if ssh-agent is running or a terminal with a recent sudo and much damage can be done.

                                      What did surprise me is how fast and easy it is to go straight to the password.

                                  3. 1

                                    Yes, but that doesn’t add any entropy: if your password is ‘love123,’ it’s still low-entropy, even if it’s stretched.

                                    Remember, too, that the client-side stretching is performed by JavaScript Mozilla delivers when you attempt to log in — as I noted, they could deliver malicious JavaScript at a whim (or under duress …).

                              1. 4

                                An easier way to do this, for Emacs users, is to run “M-x grep” (or my preference “M-x rgrep”) and when it prompts for the query string use “C-x 8 Enter” to bring up the insert-char character prompt, where you can type (and tab complete) the Unicode name or hex code. Hit enter when you’re done and it will insert the character into the grep query string and you can continue typing the rest of the query string.

                                EDIT: I misunderstood, I thought the goal was to do something like “grep λ myfiles”.

                                One way to use Emacs to achieve a similar thing to what OP is actually doing is to use “M-x insert-char” (or “C-x 8 Enter”) and then use tab completion to show a list of matching Unicode names and symbols. It supports wildcard matching using *, so you can do something like “*Lambda” - Tab to bring up a list of character names with “lambda” in them. Then, when the character is inserted, use M-x describe-char to view a lot of information about it (character class, category, bidi, code point, its code in the current encoding, etc.)

                                1. 1

                                  Or M-x counsel-unicode-char for some nice completion if you use https://github.com/abo-abo/swiper , looks like https://lists.gnu.org/archive/html/emacs-devel/2016-01/pngmRVpb5gbKs.png

                                1. 4

                                  Pretty neat. The other nearly-universal technique is to attach gdb to the process, and repeatedly stop ask for a backtrace. Works with many interpreted languages like Python or Perl, SQL, C, etc. If you collect 5-10 samples, that’s enough to start with.

                                  And strace is a quick way to see if it’s blocked on a system call or e.g. repeatedly opening the same file.

                                  1. 9

                                    If you have access to DTrace, something like this will save you time:

                                    dtrace -n ‘profile-5 /pid==475/ { ustack(8) }’

                                    Prints the bottom eight calls of the stack of PID 475 every 5Hz. Adjust to taste.

                                    1. 6

                                      The gdb technique even has a website: http://poormansprofiler.org/ =D

                                      ( https://gist.github.com/unhammer/4e91821075c2485999eb has some handy tweaks on that for OCaml programs)

                                      1. 2

                                        More tips:

                                        • If you have lots of data, mawk is often much faster than the other awks (as long as you can live without gnu extensions).
                                        • Another nice tool that I use a lot with csv/tsv’s: http://visidata.org/
                                        • And learn how to do <() style redirection, e.g.
                                            $ clean () { sed 's/^[0-9]*//' "$@" | LC_ALL=C sort -u; }
                                            $ comm -12 <(clean file1) <(clean file2)
                                            # finds common entries in file1 and file2 after removing some cruft from both
                                        
                                        1. 8

                                          In haskell, we cannot say that a Person has a name and a PetAnimal has a name

                                          I haven’t actually tried it, but I thought this was possible already in ghc 8:

                                          I’ve found annoyances with Haskell, but maybe I have no sense of aesthetics or something because the records never bugged me. I much prefer Haskell records to C++ fields, where I have to deal with public/private/protected/const/static/immutable-unless-there’s-a-bug etc.

                                          1. 6

                                            You can do it in Haskell98 if you use typeclasses instead of record syntax.

                                          1. 3

                                            I love jq but I find its syntax impossible to understand. Every time I use it I look up examples for even basic things. Maybe it makes more sense if you know javascript? I’m not saying I could design something better, just that I’ve struggled with it far more than I expected.

                                            1. 5

                                              I also have to look things up all the time with jq, takes a while to write scripts, but when they’re done, they work great. For exploratory stuff however, https://github.com/tomnomnom/gron is much simpler

                                            1. 1

                                              The template type differences stuff looks great; those pages upon pages of template errors that you can get for a simple typo are so overwhelming.

                                              1. 2

                                                That’s a pretty neat use-case :-)

                                                w-shingling is a fun algorithm to implement, I did this when learning OCaml and had use for a find-similar-docs thing at work (shameless plug).

                                                1. 1

                                                  Reposing my comment here for more engaging feedback: “One idea I’ve had for a while has been smart contextual notifications that take into account what you are doing and remind you if/when the work you do is somewhat related or at least when you’re procrastinating or resting. For example, you go to Amazon and a notification says “ah, you wanted to check this thing out a week ago remember?”. Or “oh you’re on Facebook, how about you answer that email…”. It’d need quite a bit of autonomy and AI of course, but that’s the gist of it.”

                                                  1. 1

                                                    That’s a cool idea. Regarding the “oh, you’re on facebook” thing, I use https://gist.github.com/unhammer/01c65597b5e6509b9eea to notify me about when long compiles complete, because I tend to alt-tab and forget about what I was doing when wait times get too long.

                                                    But other than that I just use really dumb notifications that arbitrarily remind me of random TODO’s dredged up from the depths of my old notes.

                                                    OTOH, I do make Emacs turn off very visible notifications (like from IRC etc.) during working hours.

                                                    1. 2

                                                      What do you use for notifications in Emacs? I use org mode, but have a bad habit of forgetting to check my agenda frequently enough.

                                                      1. 3

                                                        For scheduled agenda items, I just use the built-in appt thing

                                                        (use-package appt
                                                            :config
                                                            (add-hook 'org-finalize-agenda-hook #'org-agenda-to-appt)
                                                            (appt-activate 1)
                                                            ;; Won't work without display-time:
                                                            (display-time))
                                                        

                                                        and to ensure it’s run at least once a day I have

                                                        (add-hook 'midnight-hook (defun my-org-agenda-on-midnight ()
                                                                                   (org-agenda nil "p")
                                                                                   (delete-other-windows)
                                                                                   (org-agenda-goto-today)
                                                                                   (recenter)))
                                                        

                                                        (which also means my agenda shows up in the morning)

                                                        But for other things I’ve started using https://github.com/jwiegley/alert (I could maybe get appt to use alert too, but haven’t bothered yet).

                                                        https://github.com/akhramov/org-wild-notifier.el might be relevant if you want more control (I haven’t tried it yet)

                                                  1. 1

                                                    At least Mac has the ‘Later’ button! In Ubuntu there is no way to force close a desktop notification. You just need to wait for it to go away. It’s infuriating.

                                                    1. 1

                                                      It’s better over in Xubuntu-land, with “Do not disturb” mode (and logging during dnd, or always if you prefer) https://simon.shimmerproject.org/2017/12/12/xfce4-notifyd-sees-a-new-point-release/

                                                    1. 1

                                                      +1 on syncthing, it’s great. Just wish it had something like Syncthing Lite for iPhone (we gave up on fsync()).

                                                      I haven’t found anything I’m very happy with for browsing photos though. We have a home server that acts as the “archive” for photos that are edited/processed, some terabytes since my gf’s a photographer. Photos are nicely organised by date and “job name”/event (thanks to rapid-photo-downloader). I could have a web server that allows access, but it’d have to have download buttons in all the right places and search by exif info, dates, names. And preferably the browsing should be fast even if we’re not at home (though it’s OK if full downloads aren’t so fast). What we really wanted was just to be able to quickly browse the folders as if the files were local. But doing that over the network (with thumbnails) is so slow. I ended making a cron job on the server to generate thumbnails in a parallel hierarchy, then the laptops sync that, so there’s a browsable thumbnail folder (taking about 10G now :-S) and a simple right-click menu option in Thunar to grab the real file(s) from a thumbnail. It actually works quite well (and offline browsing of the archive is nice), but feels like a big hack …

                                                      Anyone else got similar situations with better solutions?

                                                      1. 7

                                                        Laziness is neat. But just not worth it. It makes debugging harder and makes reasoning about code harder. It was the one change in python 2->3 that I truly hate. I wish there was an eager-evaluating Haskell. At least in Haskell, due to monadic io, laziness is at least tolerable and not leaving you with tricky bugs (as trying to consume an iterator in python twice).

                                                        1. 6

                                                          I had a much longer reply written out but my browser crashed towards the end (get your shit together, Apple) so here’s the abridged version:

                                                          • Lazy debugging is only harder if your debugging approach is “printfs everywhere”. Haskell does actually allow this, but strongly discourages it to great societal benefit.

                                                          • Laziness by default forced Haskellers to never have used the strict-sequencing-as-IO hack that strict functional languages mostly fell victim to, again to great societal benefit. The result is code that’s almost always more referentially transparent, leading to vastly easier testing, easier composition, and fewer bugs in the first place.

                                                          • It’s impossible to appreciate laziness if your primary exposure to it is the piecemeal, inconsistent, and opaque laziness sprinkled in a few places in python3.

                                                          • You almost never need IO to deal with laziness and its effects. The fact that you are conflating the two suggests that you may have a bit of a wrong idea about how laziness works in practice.

                                                          • Haskell has the Strict language extension which turns on laziness by default. It’s very rarely used because most people experienced enough with Haskell to know about it prefer laziness by default. This is experimental evidence that laziness by default may actually be a good idea, once you’ve been forced to grok how it’s used in practice.

                                                          1. 1

                                                            Haskell has the Strict language extension which turns on laziness by default. It’s very rarely used because most people experienced enough with Haskell to know about it prefer laziness by default. This is experimental evidence that laziness by default may actually be a good idea, once you’ve been forced to grok how it’s used in practice.

                                                            I am not quite sure whether this is really evidence. I actually never tried to switch it on. Iwonder whether that option plays nicely with existing libraries, I gues not many are tested for not depending on lazy-evaluation for efficient evaluation. If you use Haskell and Hackage, I guess you are bound with rolling with the default.

                                                            1. 2

                                                              It works on a per-module basis. All your modules will be compiled with strict semantics, and any libraries will be compiled with the semantics they chose.

                                                          2. 3

                                                            Idris has strict evaluation. It also has dependent types, which are amazing, but strict evaluation is a pretty good perk too.

                                                            1. 2

                                                              I thought there were annotations for strictness in Haskell.

                                                              1. 3

                                                                yes, but I consider it to be the wrong default. I’d prefer having an annotation for lazy evaluation. I just remember too many cases where I have been bitten by lazy evaluation behaviour. It makes code so much more complicated to reason about.

                                                                1. 1

                                                                  Do you happen to remember more detail? I enjoy writing Haskell, but I don’t have a strong opinion on laziness. I’ve seen some benefits and rarely been bitten, so I’d like to know more.

                                                                  1. 1

                                                                    I only have vague memories to be honest. Pretty sure some where errors due to non-total functions, which I then started to avoid using a prelude that only uses total ones. But when these occured, it was hard to exactly find the code path that provoked it. Or rather: harder than it should be.

                                                                    Then, from the tooling side I started using Intero (or vim intero). (see https://github.com/commercialhaskell/intero/issues/84#issuecomment-353744900). Fairly certain that this is hard to debug because of laziness. In this thread there are a few names reporting this problem that are experienced haskell devs, so I’d consider this evidence that laziness is not only an issue to beginners that haven’t yet understood haskell.

                                                                    PS: Side remark, although I enjoy haskell, it is kind of tiring that the haskell community seems to conveniently shift between “Anyone can understand monads and write Haskell” and “If it doesn’t work for you, you aren’t experienced enough”.

                                                              2. 2

                                                                Eager-evaluating Haskell? At a high level, Ocaml is (more or less) an example of that.

                                                                It has a sweet point between high abstraction but also high mechanical sympathy. That’s a big reason why Ocaml has quite good performance despite a relatively simple optimizing compiler. As a side effect of that simple optimizing compiler (read: few transformations), it’s also easy to predict performance and do low-level debugging.

                                                                Haskell has paid a high price for default laziness.

                                                                1. 2

                                                                  As a side effect of that simple optimizing compiler (read: few transformations), it’s also easy to predict performance and do low-level debugging.

                                                                  That was used to good effect by Esterel when they did source-to-object code verification of their code generator for aerospace. I can’t find that paper right now for some reason. I did find this one on the overall project.

                                                                  1. 1

                                                                    Yes, however I would like to have Typeclasses and Monads I guess, that’s not OCaml’s playing field

                                                                    1. 1

                                                                      OCaml should Someday™ get modular implicits, which should provide some of the same niceties as typeclasses.

                                                                      1. 1

                                                                        OCaml has monads so I’m really not sure what you mean by this. Typeclasses are a big convenience but as F# has shown are by no means required for statically typed functional programming. You can get close by abusing a language feature or two but you’re better off just using existing language features to accomplish the same end that typeclases provide. I do think F# is working on adding typeclasses and I think the struggle is of course interoperability with .Net, but here’s an abudantly long github issue on the topic. https://github.com/fsharp/fslang-suggestions/issues/243

                                                                      2. 1

                                                                        F# an open source (MIT) sister language is currently beating or matching OCaml in the for fun benchmarks :). Admittedly that’s almost entirely due to the ease of parallel in F#.
                                                                        https://benchmarksgame.alioth.debian.org/u64q/fsharp.html

                                                                      3. 1

                                                                        Doesn’t lazy io make your program even more inscrutable?

                                                                        1. 1

                                                                          well, Haskell’s type system makes you aware of many side-effects, so it is a better situation than in, for example, Python.

                                                                          Again, I still prefer eager evaluation as a default, and lazy evaluation as an opt-in.

                                                                        2. 1

                                                                          Purescript is very close to what you want then - it’s basically “Haskell with less warts, and also strict” - strict mainly so that they can output clean JavaScript without a runtime.

                                                                        1. 6

                                                                          Wow, I considered myself a bash advanced user, but you always learn something new with one of these posts!

                                                                          In this case, I found a new substitution command, !$. I’d been using !!:2 for some time but never thought of $ as a “last item” replacement. Nice!

                                                                          1. 1

                                                                            There’s also the keybinding M-. (and C-M-y), see bind -P and help bind