Skip to content

Instantly share code, notes, and snippets.

View pbkwee's full-sized avatar

Peter Bryant pbkwee

View GitHub Profile
@pbkwee
pbkwee / gist:30bcd344906ca4106f2d241e2cab44e1
Created November 29, 2017 21:53
PTY allocation request failed on channel 0
Older distro (e.g. lenny) and newer kernel may result in this when ssh-ing in:
PTY allocation request failed on channel 0
You can run ssh $serverip 'bash -i' to get one off access.
You can 'fix' things with:
ssh $server 'echo "none /dev/pts devpts gid=5,mode=620 0 0" >> /etc/fstab; mount /dev/pts; cat /etc/fstab'
@pbkwee
pbkwee / eclipse-jsp-javascript-formatting-bug
Last active February 19, 2022 23:10
Eclipse jsp/javascript format bug
Bug per https://bugs.eclipse.org/bugs/show_bug.cgi?id=527275#c1
Pre-format:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String foo = "foo"; %>
<script type="text/javascript">
var hss = '<%=foo%>';
</script>
@pbkwee
pbkwee / mac-plex-makeunique
Last active February 15, 2025 21:19
Making a cloned Plex media server unique on a Mac
Plex has some ids per server that should be unique per plex server. If you clone a Plex setup (e.g. via settin up a new mac with a timemachine backup from another Plex server) you need to manually change some values.
For Windows it would be like:
https://forums.plex.tv/discussion/comment/1170859/#Comment_1170859
On a Mac you can use the defaults command.
Show the values:
# defaults read com.plexapp.plexmediaserver
@pbkwee
pbkwee / installing-libtc-native.txt
Last active April 10, 2025 21:54
Installing tomcat-native / libtcnative
VER=1.3.1
wget "http://www-eu.apache.org/dist/tomcat/tomcat-connectors/native/$VER/source/tomcat-native-$VER-src.tar.gz"
tar xzf tomcat-native-$VER-src.tar.gz
cd tomcat-native-$VER-src/native
apt install libapr1-dev libssl-dev gcc make
./configure && make && make install
Add to /usr/local/tomcat/bin/setenv.sh:
export CATALINA_OPTS="$CATALINA_OPTS -Djava.library.path=$PATH:/usr/local/apr/lib/"