From 299654a4b304506a2233486fcb75743c927f3481 Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Fri, 25 May 2012 23:16:30 +0900 Subject: Updated README to note the existence of the Debian package. --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6dfdb40..d9524aa 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,11 @@ To use the telnet server, you need to add a configuration that runs: nyancat -t -... to either an `inetd` or `xinetd` server. I am using `openbsd-inetd`, which you must give *both* arguments (`nyancat` and `-t`) to, which I found odd. +We recommend `openbsd-inetd`, but `xinetd` will work as well, and you should be able to use any other compatible `inetd` flavor. + +## Debian + +If you are running Debian Sid ("unstable" as of writing this), you can install the `nyancat` package and the `nyancat-server` pseudo-package, the latter of which will install `openbsd-inetd` (unless you have another `inetd` installed) and set up `/etc/initd.conf` properly (note that it probably won't work if you have `xinetd`, so you're on your own in that case). I am not the maintainer of this package, please direct any questions or bugs to [jmccrohan](https://github.com/jmccrohan). ## Licenses, References, etc. -- cgit v1.2.3 From d76f096ca13b558148f4b8d8c5330ef9531afd3e Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Fri, 8 Jun 2012 01:13:04 +0100 Subject: README.md: Add list of distributions with nyancat Signed-off-by: Jonathan McCrohan --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index d9524aa..95b258f 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,16 @@ Nyancat rendered in your terminal. [![Nyancats](http://i.imgur.com/snCOQl.png)](http://i.imgur.com/snCOQ.png) +## Distributions + +Nyancat is available in the following distributions: + +- [Arch](http://aur.archlinux.org/packages.php?ID=55279) +- [Debian](http://packages.qa.debian.org/n/nyancat.html) +- [Gentoo](http://packages.gentoo.org/package/games-misc/nyancat) +- [Mandriva](http://sophie.zarb.org/rpms/928724d4aea0efdbdeda1c80cb59a7d3) +- [Ubuntu](https://launchpad.net/ubuntu/+source/nyancat) + ## Setup First build the C application: -- cgit v1.2.3 From 4fad8657d67fb5b23b1f5f2d4d88a6d3c323c5f2 Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Fri, 8 Jun 2012 01:15:14 +0100 Subject: README.md: Update Debian specific information Signed-off-by: Jonathan McCrohan --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 95b258f..be793cb 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,15 @@ To use the telnet server, you need to add a configuration that runs: We recommend `openbsd-inetd`, but `xinetd` will work as well, and you should be able to use any other compatible `inetd` flavor. -## Debian +## Distribution Specific Information -If you are running Debian Sid ("unstable" as of writing this), you can install the `nyancat` package and the `nyancat-server` pseudo-package, the latter of which will install `openbsd-inetd` (unless you have another `inetd` installed) and set up `/etc/initd.conf` properly (note that it probably won't work if you have `xinetd`, so you're on your own in that case). I am not the maintainer of this package, please direct any questions or bugs to [jmccrohan](https://github.com/jmccrohan). +#### Debian/Ubuntu + +Debian and Ubuntu provide the nyancat binary through the `nyancat` package. +A `nyancat-server` package is provided to automatically setup and enable a +nyancat telnet server upon installation. I am not the maintainer of these +package, please direct any questions or bugs to the relevant distribution's bug +tracking system. ## Licenses, References, etc. -- cgit v1.2.3 From fd6b3c6de21724f8dff524d602ef88c8b3128da7 Mon Sep 17 00:00:00 2001 From: Sven Herzberg Date: Tue, 3 Jul 2012 18:10:32 +0200 Subject: do not hardcode sizes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch will fix the following warning I received from gcc: > nyancat.c: In function ‘main’: > nyancat.c:497: warning: comparison is always true due to limited range of data type * src/nyancat.c: adjust the size of the array and update the references to its size --- src/nyancat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nyancat.c b/src/nyancat.c index 234ff10..fbb3c6e 100644 --- a/src/nyancat.c +++ b/src/nyancat.c @@ -483,7 +483,7 @@ int main(int argc, char ** argv) { /* Begin Extended Option Mode */ sb_mode = 1; sb_len = 0; - memset(sb, 0, 1024); + memset(sb, 0, sizeof(sb)); break; case IAC: /* IAC IAC? That's probably not right. */ @@ -494,7 +494,7 @@ int main(int argc, char ** argv) { } } else if (sb_mode) { /* Extended Option Mode -> Accept character */ - if (sb_len < 1023) { + if (sb_len < sizeof(sb) - 1) { /* Append this character to the SB string, * but only if it doesn't put us over * our limit; honestly, we shouldn't hit -- cgit v1.2.3 From c035cf7f9ba1fdc07f77d6fa2e37e1e48c6ee3dd Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Tue, 3 Jul 2012 15:24:58 -0700 Subject: Fix type for sb_len --- src/nyancat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nyancat.c b/src/nyancat.c index fbb3c6e..67820ef 100644 --- a/src/nyancat.c +++ b/src/nyancat.c @@ -304,8 +304,8 @@ int main(int argc, char ** argv) { int k, ttype; uint32_t option = 0, done = 0, sb_mode = 0, do_echo = 0; /* Various pieces for the telnet communication */ - char sb[1024] = {0}; - char sb_len = 0; + char sb[1024] = {0}; + short sb_len = 0; /* Whether or not to show the MOTD intro */ char show_intro = 0; -- cgit v1.2.3 From 01f6c5ec53c2e545a089fc3c885bd5584c5e6821 Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Wed, 12 Sep 2012 17:40:49 -0700 Subject: Support the Suckless simple terminal `st` supports xterm-256color escapes, so just treat it the same as we treat xterm. --- src/nyancat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nyancat.c b/src/nyancat.c index 67820ef..d6eb4e4 100644 --- a/src/nyancat.c +++ b/src/nyancat.c @@ -549,6 +549,8 @@ int main(int argc, char ** argv) { ttype = 3; /* Accepts LINUX mode */ } else if (strstr(term, "vt100") && terminal_width == 40) { ttype = 7; /* No color support, only 40 columns */ + } else if (!strncmp(term, "st", 2)) { + ttype = 1; /* suckless simple terminal is xterm-256color-compatible */ } else { ttype = 2; /* Everything else */ } -- cgit v1.2.3 From 466d6da1b35bd5fae534fa429348747cab3f858e Mon Sep 17 00:00:00 2001 From: Martimus Date: Sun, 7 Oct 2012 13:29:16 -0500 Subject: Fixed typo, now following 80-characters-per-line convention where possible --- README.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index be793cb..2540824 100644 --- a/README.md +++ b/README.md @@ -28,20 +28,23 @@ To use the telnet server, you need to add a configuration that runs: nyancat -t -We recommend `openbsd-inetd`, but `xinetd` will work as well, and you should be able to use any other compatible `inetd` flavor. +We recommend `openbsd-inetd`, but `xinetd` will work as well, and you should be +able to use any other compatible `inetd` flavor. ## Distribution Specific Information #### Debian/Ubuntu -Debian and Ubuntu provide the nyancat binary through the `nyancat` package. -A `nyancat-server` package is provided to automatically setup and enable a -nyancat telnet server upon installation. I am not the maintainer of these -package, please direct any questions or bugs to the relevant distribution's bug -tracking system. +Debian and Ubuntu provide the nyancat binary through the `nyancat` package. A +`nyancat-server` package is provided to automatically setup and enable a nyancat +telnet server upon installation. I am not the maintainer of these packages, +please direct any questions or bugs to the relevant distribution's bug tracking +system. ## Licenses, References, etc. -The original source of the Nyancat animation is [prguitarman](http://www.prguitarman.com/index.php?id=348). +The original source of the Nyancat animation is +[prguitarman](http://www.prguitarman.com/index.php?id=348). -The code provided here is provided under the terms of the [NCSA license](http://en.wikipedia.org/wiki/University_of_Illinois/NCSA_Open_Source_License). +The code provided here is provided under the terms of the +[NCSA license](http://en.wikipedia.org/wiki/University_of_Illinois/NCSA_Open_Source_License). -- cgit v1.2.3 From a13d50cffc44c04c3b219742ff6812180826813c Mon Sep 17 00:00:00 2001 From: Martimus Date: Sun, 7 Oct 2012 13:40:47 -0500 Subject: Fixed comma splice --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2540824..db73410 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ able to use any other compatible `inetd` flavor. Debian and Ubuntu provide the nyancat binary through the `nyancat` package. A `nyancat-server` package is provided to automatically setup and enable a nyancat -telnet server upon installation. I am not the maintainer of these packages, +telnet server upon installation. I am not the maintainer of these packages; please direct any questions or bugs to the relevant distribution's bug tracking system. -- cgit v1.2.3 From 94995f6d405b1cd5bfbfcf50a03504ab9c5f3040 Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Tue, 13 Nov 2012 12:17:06 -0500 Subject: Install the nyancat man page (gzipped) --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index f7f9919..c850663 100644 --- a/Makefile +++ b/Makefile @@ -34,5 +34,6 @@ distcheck: $(distdir).tar.gz install: all install src/nyancat /usr/bin/${package} + gzip -9 -c < nyancat.1 > /usr/share/man/man1/nyancat.1.gz .PHONY: FORCE all clean check dist distcheck install -- cgit v1.2.3 From e948abcb64adf60faa0c9ae095fdd85d0dfab7ce Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Thu, 13 Dec 2012 19:58:37 -0800 Subject: =?UTF-8?q?Support=20building=20and=20running=20on=20=E3=81=A8?= =?UTF-8?q?=E3=81=82=E3=82=8BOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/nyancat.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/nyancat.c b/src/nyancat.c index d6eb4e4..6ab0403 100644 --- a/src/nyancat.c +++ b/src/nyancat.c @@ -58,9 +58,22 @@ #include #include #include -#include #include +#ifdef __toaru__ + +#include + +DEFN_SYSCALL2(nanosleep, 46, unsigned long, unsigned long); + +int usleep(useconds_t time) { + syscall_nanosleep(0, time / 10000); +} + +#else +#include +#endif + #ifndef TIOCGWINSZ #include #ifdef ECHO @@ -517,9 +530,20 @@ int main(int argc, char ** argv) { } /* Also get the number of columns */ +#ifdef __toaru__ + if (strstr(term, "toaru")) { + printf("\033[1003z"); + fflush(stdout); + int height; + scanf("%d,%d", &terminal_width, &height); + } else { + terminal_width = 80; /* better safe than sorry */ + } +#else struct winsize w; ioctl(0, TIOCGWINSZ, &w); terminal_width = w.ws_col; +#endif } /* Convert the entire terminal string to lower case */ @@ -535,6 +559,8 @@ int main(int argc, char ** argv) { /* Do our terminal detection */ if (strstr(term, "xterm")) { ttype = 1; /* 256-color, spaces */ + } else if (strstr(term, "toaru")) { + ttype = 1; /* emulates xterm */ } else if (strstr(term, "linux")) { ttype = 3; /* Spaces and blink attribute */ } else if (strstr(term, "vtnt")) { -- cgit v1.2.3 From 1652cd3bd12088296c27efba909bdc1b4123ae3c Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Fri, 21 Dec 2012 03:50:38 -0800 Subject: For the morons using solarized --- src/nyancat.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/nyancat.c b/src/nyancat.c index 6ab0403..02965a5 100644 --- a/src/nyancat.c +++ b/src/nyancat.c @@ -587,18 +587,18 @@ int main(int argc, char ** argv) { switch (ttype) { case 1: colors[','] = "\033[48;5;17m"; /* Blue background */ - colors['.'] = "\033[48;5;15m"; /* White stars */ - colors['\''] = "\033[48;5;0m"; /* Black border */ + colors['.'] = "\033[48;5;255m"; /* White stars */ + colors['\''] = "\033[48;5;232m"; /* Black border */ colors['@'] = "\033[48;5;230m"; /* Tan poptart */ colors['$'] = "\033[48;5;175m"; /* Pink poptart */ colors['-'] = "\033[48;5;162m"; /* Red poptart */ - colors['>'] = "\033[48;5;9m"; /* Red rainbow */ - colors['&'] = "\033[48;5;202m"; /* Orange rainbow */ - colors['+'] = "\033[48;5;11m"; /* Yellow Rainbow */ - colors['#'] = "\033[48;5;10m"; /* Green rainbow */ + colors['>'] = "\033[48;5;196m"; /* Red rainbow */ + colors['&'] = "\033[48;5;214m"; /* Orange rainbow */ + colors['+'] = "\033[48;5;226m"; /* Yellow Rainbow */ + colors['#'] = "\033[48;5;118m"; /* Green rainbow */ colors['='] = "\033[48;5;33m"; /* Light blue rainbow */ colors[';'] = "\033[48;5;19m"; /* Dark blue rainbow */ - colors['*'] = "\033[48;5;8m"; /* Gray cat face */ + colors['*'] = "\033[48;5;240m"; /* Gray cat face */ colors['%'] = "\033[48;5;175m"; /* Pink cheeks */ break; case 2: -- cgit v1.2.3 From 3e1afbd2a68e0634c073bc37f7d493421b39f7a2 Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Fri, 21 Dec 2012 03:59:38 -0800 Subject: Better white and black --- src/nyancat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nyancat.c b/src/nyancat.c index 02965a5..759b9bf 100644 --- a/src/nyancat.c +++ b/src/nyancat.c @@ -587,8 +587,8 @@ int main(int argc, char ** argv) { switch (ttype) { case 1: colors[','] = "\033[48;5;17m"; /* Blue background */ - colors['.'] = "\033[48;5;255m"; /* White stars */ - colors['\''] = "\033[48;5;232m"; /* Black border */ + colors['.'] = "\033[48;5;231m"; /* White stars */ + colors['\''] = "\033[48;5;16m"; /* Black border */ colors['@'] = "\033[48;5;230m"; /* Tan poptart */ colors['$'] = "\033[48;5;175m"; /* Pink poptart */ colors['-'] = "\033[48;5;162m"; /* Red poptart */ -- cgit v1.2.3 From 3b70f513774d2e7098db93bcc9e51497a2037d44 Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Fri, 11 Jan 2013 15:52:05 -0800 Subject: Update src/nyancat.c update copyright date, happy new year --- src/nyancat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nyancat.c b/src/nyancat.c index 759b9bf..e7d3f38 100644 --- a/src/nyancat.c +++ b/src/nyancat.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Kevin Lange. All rights reserved. + * Copyright (c) 2011-2013 Kevin Lange. All rights reserved. * * Developed by: Kevin Lange * http://github.com/klange/nyancat -- cgit v1.2.3 From 5fd6f4b7b12df2ed7ba24ba955a2fb9ce299cd07 Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Mon, 28 Jan 2013 21:38:05 -0800 Subject: Tick the version number. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c850663..291623f 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ package = nyancat -version = 1.0 +version = 1.1 tarname = $(package) distdir = $(tarname)-$(version) -- cgit v1.2.3 From 4a907ca8eee73fb25fed599447292a45d1daa256 Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Mon, 28 Jan 2013 21:43:05 -0800 Subject: Add CHANGELOG --- CHANGELOG | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 CHANGELOG diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..56973f3 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,10 @@ +1.1 (tagged on 2013-01-28) + * Support the Suckless terminal + * Support building for とあるOS + * Changed color palette for 256 color modes (fixes alternate color + schemes looking wonky) + * Install the man page as part of package building + * Fix a potential bug processing extended options + +1.0 + * Initial public release for packaging -- cgit v1.2.3 From 634c7d3e97c5bda9635815a55eb7294c3eb0ac62 Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Thu, 7 Mar 2013 19:43:48 -0800 Subject: Set alarm for extended options. Instead of clearing the alarm, set it to two seconds; Previously, this could, potentially, not finish at all on some telnet clients, which is definitely bad. This is a reasonable workaround. --- src/nyancat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nyancat.c b/src/nyancat.c index e7d3f38..2137849 100644 --- a/src/nyancat.c +++ b/src/nyancat.c @@ -443,14 +443,14 @@ int main(int argc, char ** argv) { if (sb[0] == TTYPE) { /* This was a response to the TTYPE command, meaning * that this should be a terminal type */ - alarm(0); + alarm(2); strcpy(term, &sb[2]); done++; } else if (sb[0] == NAWS) { /* This was a response to the NAWS command, meaning * that this should be a window size */ - alarm(0); + alarm(2); terminal_width = sb[2]; done++; } -- cgit v1.2.3 From 4f4d5d418a0e060b8c6418995088eeec39b54c35 Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Thu, 7 Mar 2013 19:47:03 -0800 Subject: Reset alarm before setting to 2secs --- src/nyancat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nyancat.c b/src/nyancat.c index 2137849..cef7034 100644 --- a/src/nyancat.c +++ b/src/nyancat.c @@ -443,6 +443,7 @@ int main(int argc, char ** argv) { if (sb[0] == TTYPE) { /* This was a response to the TTYPE command, meaning * that this should be a terminal type */ + alarm(0); alarm(2); strcpy(term, &sb[2]); done++; @@ -450,6 +451,7 @@ int main(int argc, char ** argv) { else if (sb[0] == NAWS) { /* This was a response to the NAWS command, meaning * that this should be a window size */ + alarm(0); alarm(2); terminal_width = sb[2]; done++; -- cgit v1.2.3 From 4960f3ff2fc7c4313df1980d5c4f0a3c5fec48aa Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Thu, 7 Mar 2013 19:48:47 -0800 Subject: Hm, or not. --- src/nyancat.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/nyancat.c b/src/nyancat.c index cef7034..e7d3f38 100644 --- a/src/nyancat.c +++ b/src/nyancat.c @@ -444,7 +444,6 @@ int main(int argc, char ** argv) { /* This was a response to the TTYPE command, meaning * that this should be a terminal type */ alarm(0); - alarm(2); strcpy(term, &sb[2]); done++; } @@ -452,7 +451,6 @@ int main(int argc, char ** argv) { /* This was a response to the NAWS command, meaning * that this should be a window size */ alarm(0); - alarm(2); terminal_width = sb[2]; done++; } -- cgit v1.2.3 From 43097ebfc2bc9bc0f721f5f80dc1aede1f7e10d7 Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Thu, 7 Mar 2013 19:54:32 -0800 Subject: Ah, right, yes. --- src/nyancat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nyancat.c b/src/nyancat.c index e7d3f38..44bdf06 100644 --- a/src/nyancat.c +++ b/src/nyancat.c @@ -443,14 +443,14 @@ int main(int argc, char ** argv) { if (sb[0] == TTYPE) { /* This was a response to the TTYPE command, meaning * that this should be a terminal type */ - alarm(0); + alarm(2); strcpy(term, &sb[2]); done++; } else if (sb[0] == NAWS) { /* This was a response to the NAWS command, meaning * that this should be a window size */ - alarm(0); + alarm(2); terminal_width = sb[2]; done++; } @@ -521,6 +521,7 @@ int main(int argc, char ** argv) { } } } + alarm(0); } else { /* We are running standalone, retrieve the * terminal type from the environment. */ -- cgit v1.2.3