This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tested on 2020-01-04 on latest rasbian (buster) and nano 4.7 | |
sudo apt-get install pkg-config libncursesw5-dev groff | |
URL="https://www.nano-editor.org$(curl https://www.nano-editor.org/download.php 2>/dev/null | grep -o '<a .*href=.*>' | sed -e 's/<a /\n<a /g' | sed -e 's/<a .*href=['"'"'"]//' -e 's/["'"'"'].*$//' -e '/^$/ d' | egrep '\.tar\.gz$')" | |
wget "$URL" | |
tar zxvf nano-*.tar.gz | |
cd nano-*[0-9] | |
sudo mkdir -p /usr/local/share/doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> " ".join("%02x"%b for b in bytearray(u'abc•£¶','utf-8')) | |
'61 62 63 e2 80 a2 c2 a3 c2 b6' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print((lambda s:repr(str(s)).replace(' ',u'·'))('joe fred\n')[1:-1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _Getch: | |
"""Gets a single character from standard input. Does not echo to the screen.""" | |
def __init__(self): | |
try: | |
self.impl = _GetchWindows() | |
except ImportError: | |
self.impl = _GetchUnix() | |
def __call__(self): return self.impl() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python -c "import subprocess ; print subprocess.check_output(['stty', 'size']).split()" | |
see: http://stackoverflow.com/questions/566746/how-to-get-console-window-width-in-python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt-get upgrade libncurses5 libncursesw5 git curl wget automake autopoint | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
automake is already the newest version (1:1.15-4ubuntu1). | |
autopoint is already the newest version (0.19.7-2ubuntu3). | |
curl is already the newest version (7.47.0-1ubuntu2). | |
git is already the newest version (1:2.7.4-0ubuntu1). | |
libncurses5 is already the newest version (6.0+20160213-1ubuntu1). | |
libncursesw5 is already the newest version (6.0+20160213-1ubuntu1). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: src/winio.c | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
--- src/winio.c (revision ) | |
+++ src/winio.c (date 1462931713000) | |
@@ -3076,12 +3076,6 @@ | |
(long)openfile->filebot->lineno, linepct, | |
(unsigned long)cur_xpt, (unsigned long)cur_lenpt, colpct, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: src/winio.c | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
--- src/winio.c (date 1462931713000) | |
+++ src/winio.c (revision ) | |
@@ -3076,6 +3076,12 @@ | |
(long)openfile->filebot->lineno, linepct, | |
(unsigned long)cur_xpt, (unsigned long)cur_lenpt, colpct, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Update letsencrypt on a lighttp installation | |
# | |
# if you installed letsencrypt in a non-standard location you | |
# can set the LEDIR env var before you run this script | |
# | |
# setup letsencrypt install directory | |
STDLEDIR=/opt/letsencrypt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# script for testing nano build configurations | |
grep 'GNU nano - an enhanced clone of the Pico text editor' README >/dev/null 2>&1 | |
if [ $? -ne 0 ] ; then | |
printf "\n\e[31mError: Must be run from the nano dev folder! \e[39m\n" | |
exit 1 | |
fi |