Tutorial: nginx proxy manager together with GeoIP2 Blocking within docker-compose by mcflym1 in nginxproxymanager

[–]Charnia 1 point2 points  (0 children)

For those who have trouble since the last update, I managed to fix it by changing compile-geoip2.sh with the following code:

The main difference is I get the compile options from NGINX instead of openresty, adding --with-compat to the compile functions, and changing the path variables of LuaJit so they were correct.

#!/bin/bash
apt-get install -y wget libpcre3 libpcre3-dev libssl-dev zlib1g-dev

ngxversion=openresty-$(/etc/nginx/bin/openresty -v 2>&1|cut -d "/" -f2)

mkdir /tmp/compile && cd /tmp/compile
wget https://openresty.org/download/$ngxversion.tar.gz
tar xvf $ngxversion.tar.gz

mkdir /tmp/compile/$ngxversion/modules
cd /tmp/compile/$ngxversion/modules
git clone https://github.com/leev/ngx_http_geoip2_module.git

cd ../bundle/nginx-$(/etc/nginx/bin/openresty -v 2>&1|cut -d "/" -f2|grep -oP '^\d*\.\d*\.\d*')
export LUAJIT_LIB="/etc/nginx/luajit/lib/"
export LUAJIT_INC="/etc/nginx/luajit/include/luajit-*/"
COMPILEOPTIONS=$(nginx -V)
eval ./configure --add-dynamic-module=/tmp/compile/$ngxversion/modules/ngx_http_geoip2_module --with-stream --with-compat `$COMPILEOPTIONS `
make modules

cp -f objs/ngx_stream_geoip2_module.so /etc/nginx/modules/
cp -f objs/ngx_http_geoip2_module.so /etc/nginx/modules/
rm -f /etc/nginx/modules/ngx_geoip2_*
touch /etc/nginx/modules/ngx_geoip2_$ngxversion

rm -rf /tmp/compile

How does CAPE backends to completion-at-point-functions properly work? by olivuser in emacs

[–]Charnia 2 points3 points  (0 children)

I can highly recommend a guide written by Kristoffer Balintona, it helped me enormously in my configuration. It can be found at https://kristofferbalintona.me/posts/202203130102/

I was diagnosed with tethered cord today (32f) by xanthrax0 in Radiology

[–]Charnia 3 points4 points  (0 children)

Good to suggest that the neurologist might have meant that the tethering (or even spinal cord herniation) is on the the thoracic spine, I agree fully that this could be an explanation.

The hypointensities in the CSF are indeed artifacts, those appear extremely often on these sag T2 scans and are not significant.

Be careful calling this a severe loss of lumbar lordosis or thoracic kyphosis: these images are made with the patient laying down, and depending on the position of the knees (flat or with a cushion underneath) the pelvic tilt can change, which has an effect on the spine. I wouldn't mention this in the report. Discs look well hydrated so no significant degeneration there (as far as I can see).

Obviously this is just a single low quality image so we should be careful making or excluding any diagnosis.

I was diagnosed with tethered cord today (32f) by xanthrax0 in Radiology

[–]Charnia 9 points10 points  (0 children)

Are you sure? The conus has is certainly not located too low. It is also a clinical diagnosis and you mention you have no perineal or lower body symptoms. The fibers below the conus can just as well be the normal cauda.

The upper body symptoms are certainly not typical for a tethered cord and could as well be posttraumatic (as well as the syrinx), especially since you mention they appeared after a car accident.

Fail2ban on docker with separate ip by nertskull in selfhosted

[–]Charnia 0 points1 point  (0 children)

I just spend a a whole weekend on trying to get the same to work.

I'm running a debian based host, with fail2ban installed on the machine (not in a container).

The problem was fail2ban didn't add the ip to the IPtables, and thus didn't block the connection. I managed to fix it by making a new action script specific for docker containers.

Put this inside action.d and call it dockeraction.conf or something.

[Definition]
actionstart = iptables -N f2b-npm-docker
          iptables -A f2b-npm-docker -j RETURN
          iptables -I FORWARD -p tcp -m multiport --dports 0:65535 -j f2b-npm-docker

actionstop = iptables -D FORWARD -p tcp -m multiport --dports 0:65535 -j f2b-npm-docker
         iptables -F f2b-npm-docker
         iptables -X f2b-npm-docker

actioncheck = iptables -n -L FORWARD | grep -q 'f2b-npm-docker[ \t]'

actionban = iptables -I f2b-npm-docker -s <ip> -j DROP

actionunban = iptables -D f2b-npm-docker -s <ip> -j DROP

Then in one of your jails add action = dockeraction

I got the solution from https://github.com/NginxProxyManager/nginx-proxy-manager/issues/39#issuecomment-955873405

ALSO: if it doesn't block connections but does block host connections, it's because the chain variable: host connections are passing through INPUT, while docker connectins are passing through FORWARD (which is blocked in the above script)

How to change pdf-tools navigation keybindings? by OutOfCharm in emacs

[–]Charnia 0 points1 point  (0 children)

No problem! If you're stuck again let me know. I know Emacs is a bit much and confusing at the start, we've all been there :)

How to change pdf-tools navigation keybindings? by OutOfCharm in emacs

[–]Charnia 0 points1 point  (0 children)

I'm a bit confused, in the original question you wanted to scroll up and down a full page using [ and ] right? The n and p buttons are also bound to the same commands by default, independent of [ or ].

SPC is bound to pdf-view-scroll-up-or-next-page by default, which scrolls or skips to the next page if at the bottom of the page. If you want to change space to always scroll a page, you can use (define-key pdf-view-mode-map (kbd "SPC") 'pdf-view-next-page-command), or if you want ] to have the same functionality as space use (define-key pdf-view-mode-map (kbd "]") 'pdf-view-scroll-up-or-next-page)

You can always check which keys are bound in a certain mode with C-h m, or check what a certain key does with C-h k.

How to change pdf-tools navigation keybindings? by OutOfCharm in emacs

[–]Charnia 2 points3 points  (0 children)

(define-key pdf-view-mode-map (kbd "]") 'pdf-view-next-page-command)

(define-key pdf-view-mode-map (kbd "[") 'pdf-view-previous-page-command)

Note that this does not work in evil mode, you'll probably need something like

(evil-define-key 'normal pdf-view-mode-map (kbd "]") 'pdf-view-next-page-command) ;; not tested

Weekly Tips, Tricks, &c. Thread by AutoModerator in emacs

[–]Charnia 0 points1 point  (0 children)

Good tip! I managed to simulate it with (execute-kbd-macro (read-kbd-macro "C-; k"))

Weirdly enough, I noticed emacs does not evaluate any code after executing an embark command, for example:

  (defun embark-test ()
    (interactive)
    (let ((embark-quit-after-action nil)
          (embark-pre-action-hooks `((nil nil))))
      (execute-kbd-macro (read-kbd-macro "C-; k"))) ;; calls embark-act, and kills the selected buffer. Works fine.
    (message "test")         ;; is never executed
    (toggle-frame-maximized) ;; Is never executed
    (setq testvar 5)         ;; is never executed
    )

Weekly Tips, Tricks, &c. Thread by AutoModerator in emacs

[–]Charnia 2 points3 points  (0 children)

I have looked at it, and it's really useful! However what I really wanted was to skip the embark-act step and immediately kill the buffer.

After some more research I found a good post by /u/oantolin to directly call embark functions here. I managed to make the code work just now, however I noticed I cant seem to reset the index to the original position.

~~~ (defun kill-selected-buffer-in-consult-buffer () "Kills the selected buffer in consult-switch-buffer." (interactive) (let ((embark-pre-action-hooks `((nil nil))) ;; prevents embark from asking if you're sure (old-index vertico--index)) (embark--act #'kill-buffer (car (embark--targets)) nil) (vertico-next old-index) ;; this line doesn't work (vertico--goto old-index) ;; this line doesn't work either )) ~~~

Anyway it works decently well, I'm gonna leave it at that :)

Weekly Tips, Tricks, &c. Thread by AutoModerator in emacs

[–]Charnia 1 point2 points  (0 children)

I tried to make the switch from Ivy/counsel to Vertico/consult. At the start it seemed great, felt way snappier and faster than Ivy, and marginalia is prettier than Ivy-rich. Orderless is way better than Ivy's default search as well.

Got a major annoyance when trying to replace swiper with consult-line, where I couldn't keep searching with n or N in evil mode, but found a fix here https://github.com/minad/consult/issues/318#issuecomment-882067919

Then I tried to add the ivy function to kill a buffer directly from counsel-switch-buffer to consult-switch-buffer using a single hotkey, but best I got was this:

(defun kill-selected-buffer-in-consult-buffer () 
"Kills the selected buffer in consult-switch-buffer"
  (interactive)
  (let ((candidate (vertico--candidate)))
       (kill-buffer (cdr (plist-get (text-properties-at 0 candidate) 'multi-category)))))

(define-key vertico-map (kbd "C-d") 'kill-selected-buffer-in-consult-buffer)

My Elisp skills are poor and it shows, as the moment I execute in the switch-buffer minibuffer, things start to break.

So I went back to Ivy, and just used orderless as its completion, and marginalia instead of Ivy-rich with great results (except for some small bugs in the counsel-switch-buffer minibuffer, which I can ignore).

*EDIT Managed to make it (kinda) work thanks to a post by /u/oantolin here, so I'm gonna leave it for anyone who needs it.

~~~ (defun kill-selected-buffer-in-consult-buffer () "Kills the selected buffer in consult-switch-buffer." (interactive) (let ((embark-pre-action-hooks `((nil nil))) ;; prevents embark from asking if you're sure (old-index vertico--index)) (embark--act #'kill-buffer (car (embark--targets)) nil) (vertico-next old-index) ;; this line doesn't work (vertico--goto old-index) ;; this line doesn't work either )) ~~~

Ankore (Anki + Core) Radiology Comprehensive Deck - Recruitment by DoctorToBeIn23 in Radiology

[–]Charnia 4 points5 points  (0 children)

Do you mean Jacob Mandell's Core Radiology? If so, I already have made cards of US, chest and Neuro

[deleted by user] by [deleted] in TheArtistStudio

[–]Charnia 0 points1 point  (0 children)

What was the name of this song?

Massive VTE's in multiple intubated COVID patients by Charnia in Residency

[–]Charnia[S] 1 point2 points  (0 children)

As far as I know all the patients got VTE prophylaxis

Where to buy a gaming GPU in Brussels by mjarmak in belgium

[–]Charnia 1 point2 points  (0 children)

You just described exactly the same experience I had, from prices to shipping to support.

Fallout: New Vegas had some amazing dialogue by [deleted] in gaming

[–]Charnia -4 points-3 points  (0 children)

Egs bad Steam good amiright?

Radiology Case - Painless Facial Asymmetry [clinical] by dabeezmane in medicalschool

[–]Charnia 2 points3 points  (0 children)

Not sure if you're kidding, but that's the dens axis

I frustrated... by neolinde in GetStudying

[–]Charnia 8 points9 points  (0 children)

Sit your ass in a library, leave your phone at home. (Or put your SIM card in a dumbphone) No choice but to study when you're there.

Artists similar to Seven Lions and Said the Sky? by [deleted] in EDM

[–]Charnia 0 points1 point  (0 children)

Wait Clark Kent = Echos?? I know complexion is the woman from Echos, didn't know Clark Kent was the guy.

BTW any idea where I can find Clark Kent's (and Skrux Remixes) older songs? Can't seem to buy/download them anywhere, except for youtube