Skip to content

Repository files navigation

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
<head>
<title>Geordi Readme</title>
</head>
<body>
<h1>Geordi Readme</h1>
<hr/><h2>Table of Contents</h2>
<ul>
<li><a href='#installation'>1. Installation</a></li>
<li><a href='#running'>2. Running geordi</a></li>
<li><a href='#localization'>3. Localization</a></li>
<li><a href='#problems'>4. Known problems</a></li>
</ul>
<hr/><h2 id='installation'>1. Installation</h2>
<h3>1.1&emsp;Prerequisites</h3>
<ul>
<li>An i386 or x86-64 machine</li>
<li>GNU/Linux &ge; 2.6.34</li>
<li>GCC/G++ &ge; 4.6</li>
<li><a href='http://www.boost.org/'>Boost</a> &ge; 1.33 (Only the headers are needed)</li>
<li><a href='http://www.haskell.org/ghc/'>GHC</a> &ge; 7.4
<!--<p>On Ubuntu, it is highly recommended to use GHC packages from the Ubuntu repositories. Use of haskell.org's GHC packages may result in strange "g++: Virtual timer expired" errors.</p>
<p>Some distributions package GHC libraries separately. If, when compiling, you get errors like “Could not find module "Control.Monad.State"”, look for separate mtl and network packages.</p> -->
</li>
</ul>
<p>In addition, geordi depends on a number of <a href='http://hackage.haskell.org/'>Hackage</a> packages, but these will be downloaded, built, and installed automatically by <a href='http://hackage.haskell.org/trac/hackage/wiki/CabalInstall'>cabal-install</a>.</p>
<h3>1.2&emsp;Installing geordi</h3>
<p>The easiest way to build and install geordi is with <a href='http://hackage.haskell.org/trac/hackage/wiki/CabalInstall'>cabal-install</a>, part of the <a href='http://hackage.haskell.org/platform//'>Haskell Platform</a>.</p>
<p>In the geordi directory, say:</p>
<pre> cabal update
cabal install</pre>
<p>This will download, build, and install any missing dependencies from <a href='http://hackage.haskell.org/'>Hackage</a>, and will then build and install geordi (by default into <tt>$HOME/.cabal/</tt>).</p>
<h3>1.3&emsp;Setting up a chroot</h3>
<p>To set up a directory for geordi to chroot into when it starts, do the following:</p>
<ol>
<li><p>Edit <kbd>$PREFIX/share/geordi-0/compile-config</kbd> to your liking (where <kbd>$PREFIX</kbd> is the location where Cabal installed geordi, which defaults to <kbd>$HOME/.cabal/</kbd>). Check that the g++ path refers to the actual g++ binary, not some wrapper that adds output coloring or something.</p></li>
<li><p>On Debian and Ubuntu, replace</p><pre> group = "nobody"</pre><p>with</p><pre> group = "nogroup"</pre><p> in <kbd>$PREFIX/share/geordi-0/jail-config</kbd>.</p></li>
<li><kbd>geordi-mkrt</kbd><p>This creates <kbd>$PREFIX/share/geordi-0/rt</kbd>, which will be our chroot root, and copies various files into it that GCC needs in order to function.</p><p>If you ever make further modifications to <kbd>compile-config</kbd>, throw the old <kbd>rt</kbd> away and build a new one with <kbd>geordi-mkrt</kbd> (followed by <kbd>geordi-compile-prelude</kbd>).</p></li>
<li><kbd>geordi-compile-prelude</kbd><p>This compiles the prelude files in <kbd>$PREFIX/share/geordi-0/prelude</kbd> to produce <kbd>$PREFIX/share/geordi-0/rt/{prelude.hpp.gch,prelude.a,libtpreload.so.0.0}</kbd>.</p>
</li>
</ol>
<p>Now try running</p><pre> sudo geordi-local "&lt;&lt; 'x'"</pre>
<p>If this complains about missing executables like <kbd>as</kbd> and <kbd>ld</kbd> which are present in a non-standard location in your <kbd>PATH</kbd>, try</p><pre> sudo env PATH=$PATH geordi-local "&lt;&lt; 'x'"</pre>
<p>If you get errors complaining about missing libraries and such (this can happen due to differing versions or configurations of gcc), try locating those on your system and manually copying them into the corresponding place in <kbd>$PREFIX/share/geordi-0/rt</kbd>.</p>
<p>If your <kbd>compile-config</kbd> points to a custom-built gcc in a non-standard location <kbd>/foo/bar</kbd> and you get an error about <kbd>/t</kbd> missing some libraries, try adding <kbd>-Wl,-rlink,/foo/bar/lib</kbd> to <kbd>LINK_FLAGS</kbd> in <kbd>compile-config</kbd>.</p>
<h3>1.4&emsp;Running the testsuite</h3>
<p>A modest testsuite can now be run with <kbd>sudo geordi-testsuite</kbd> (recommended).</p>
<hr/><h2 id='running'>2. Running geordi</h2>
<h3 id='locally'>2.1&emsp;<kbd>geordi-local</kbd></h3>
<p><kbd>geordi-local</kbd> lets one test snippets locally (that is, without connecting to any IRC server).</p>
<p>Usage:&emsp;<kbd>sudo geordi-local [option]... [request]...</kbd></p>
<p>Request syntax is described in the <a href='http://www.eelis.net/geordi/#usage'>manual</a>, except that here the nickname (and colon/comma) must be omitted.</p>
<p>Options:</p>
<dl>
<dt><kbd>-h</kbd> / <kbd>--help</kbd></dt>
<dd><p>Display help and exit.</p></dd>
</dl>
<p>If any requests are specified, they are evaluated and their results are shown. If the first request starts with a request option, interject “<kbd>--</kbd>” to prevent it from being interpreted as a command option.</p>
<p>If no requests are specified, the program goes into a Read-Eval-Print-Loop.</p>
<h3 id='ircbot'>2.2&emsp;<kbd>geordi-irc</kbd></h3>
<p>Usage:&emsp;<kbd>sudo geordi-irc [option]...</kbd></p>
<p>Starting an IRC bot with root permissions should make one seriously nervous. Geordi requires root permissions only because <a href='http://linux.die.net/man/2/chroot'>chroot(2)</a> does. Geordi chroots into <kbd>rt</kbd> as one of the first things it does on startup, and changes to the user and group specified in jail-config before it starts responding to IRC messages.</p>
<p>Options:</p>
<dl>
<dt><kbd>-c &lt;file></kbd> / <kbd>--config &lt;file></kbd></dt>
<dd><p>Load bot configuration from &lt;file> instead of <kbd>irc-config</kbd>.</p></dd>
<dt><kbd>-h</kbd> / <kbd>--help</kbd></dt>
<dd><p>Display help and exit.</p></dd>
</dl>
<h4 id='nickserv'>NickServ identification</h4>
<p>To have the bot identify to NickServ, change the following line in <kbd>irc-config</kbd>:</p>
<pre> , nick_pass = Nothing</pre>
<p>into:</p>
<pre> , nick_pass = Just "mypassword"</pre>
<h4>Nickless requests</h4>
<p>To have the bot respond to nickless requests (e.g. "<kbd>&lt;&lt; 3</kbd>") in channels #foo, #bar, and #bas, use:</p>
<pre> , allow_nickless_requests_in = ["#foo", "#bar", "#bas"]</pre>
<h4 id='reconnect'>Auto-reconnect</h4>
<p>Geordi does not auto-reconnect. For that, just use something like</p><pre> while true; do geordi-irc; sleep 120; done</pre>
<h4 id='multinetwork'>Connecting to multiple networks</h4>
<p>Make config files for the different networks. Then run one <kbd>geordi-irc</kbd> instance for each network, passing -c arguments pointing to the respective config files. The <kbd>rt</kbd> directory will be safely shared.</p>
<h4>Censoring phrases</h4>
<p>Some networks automatically kick or ban clients that utter certain phrases (like botnet commands). To prevent a geordi bot from uttering these, list regexes for them in irc-config. E.g.:</p>
<pre> , censor = ["some naughty phrase", "some wicked utterance"]</pre>
<hr/><h2 id='localization'>3. Localization</h2>
<p>To get compiler diagnostics (and some (but not all) other geordi messages) in a locale of your choice, copy the following into <kbd>rt</kbd> (preserving paths, for example using <kbd>cp --parents</kbd>):</p>
<ul>
<li>/usr/lib/locale/foo_BAR.utf8/*</li>
<li>/usr/share/locale/foo/LC_MESSAGES/{cpplib,gcc,libc,libstdc++,opcodes}.mo</li>
</ul>
<p>These paths might differ somewhat on your system.</p>
<p>You may need to install a separate GCC locales package or other kind of language pack for your distro, to get the files above.</p>
<p>Furthermore, not all of the files above may be available for your locale; copy those that are.</p>
<p>Additionally, the LC_ALL environment variable must be set to foo_BAR.utf8 when geordi is started. Note that sudo clears environment variables by default, so either use</p><pre> sudo -E geordi-...</pre><p>or use</p><pre> sudo env LC_ALL=foo_BAR.utf8 geordi-...</pre>
<hr/><h2 id='problems'>4. Known problems</h2>
<ul>
<li>
Because <kbd>geordi-irc</kbd> connects as root, IRC servers that query ident may get a root response and may decide to reject the connection. (Quakenet is known to do this.)
</li>
</ul>
</body>
</html>

About

IRC C++ eval bot

Resources

Stars

4 stars

Watchers

7 watching

Forks

Releases

Packages

Contributors

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
GitHub - LearnProgramming/geordi: IRC C++ eval bot · GitHub
Skip to content

Repository files navigation

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
<head>
<title>Geordi Readme</title>
</head>
<body>
<h1>Geordi Readme</h1>
<hr/><h2>Table of Contents</h2>
<ul>
<li><a href='#installation'>1. Installation</a></li>
<li><a href='#running'>2. Running geordi</a></li>
<li><a href='#localization'>3. Localization</a></li>
<li><a href='#problems'>4. Known problems</a></li>
</ul>
<hr/><h2 id='installation'>1. Installation</h2>
<h3>1.1&emsp;Prerequisites</h3>
<ul>
<li>An i386 or x86-64 machine</li>
<li>GNU/Linux &ge; 2.6.34</li>
<li>GCC/G++ &ge; 4.6</li>
<li><a href='http://www.boost.org/'>Boost</a> &ge; 1.33 (Only the headers are needed)</li>
<li><a href='http://www.haskell.org/ghc/'>GHC</a> &ge; 7.4
<!--<p>On Ubuntu, it is highly recommended to use GHC packages from the Ubuntu repositories. Use of haskell.org's GHC packages may result in strange "g++: Virtual timer expired" errors.</p>
<p>Some distributions package GHC libraries separately. If, when compiling, you get errors like “Could not find module "Control.Monad.State"”, look for separate mtl and network packages.</p> -->
</li>
</ul>
<p>In addition, geordi depends on a number of <a href='http://hackage.haskell.org/'>Hackage</a> packages, but these will be downloaded, built, and installed automatically by <a href='http://hackage.haskell.org/trac/hackage/wiki/CabalInstall'>cabal-install</a>.</p>
<h3>1.2&emsp;Installing geordi</h3>
<p>The easiest way to build and install geordi is with <a href='http://hackage.haskell.org/trac/hackage/wiki/CabalInstall'>cabal-install</a>, part of the <a href='http://hackage.haskell.org/platform//'>Haskell Platform</a>.</p>
<p>In the geordi directory, say:</p>
<pre> cabal update
cabal install</pre>
<p>This will download, build, and install any missing dependencies from <a href='http://hackage.haskell.org/'>Hackage</a>, and will then build and install geordi (by default into <tt>$HOME/.cabal/</tt>).</p>
<h3>1.3&emsp;Setting up a chroot</h3>
<p>To set up a directory for geordi to chroot into when it starts, do the following:</p>
<ol>
<li><p>Edit <kbd>$PREFIX/share/geordi-0/compile-config</kbd> to your liking (where <kbd>$PREFIX</kbd> is the location where Cabal installed geordi, which defaults to <kbd>$HOME/.cabal/</kbd>). Check that the g++ path refers to the actual g++ binary, not some wrapper that adds output coloring or something.</p></li>
<li><p>On Debian and Ubuntu, replace</p><pre> group = "nobody"</pre><p>with</p><pre> group = "nogroup"</pre><p> in <kbd>$PREFIX/share/geordi-0/jail-config</kbd>.</p></li>
<li><kbd>geordi-mkrt</kbd><p>This creates <kbd>$PREFIX/share/geordi-0/rt</kbd>, which will be our chroot root, and copies various files into it that GCC needs in order to function.</p><p>If you ever make further modifications to <kbd>compile-config</kbd>, throw the old <kbd>rt</kbd> away and build a new one with <kbd>geordi-mkrt</kbd> (followed by <kbd>geordi-compile-prelude</kbd>).</p></li>
<li><kbd>geordi-compile-prelude</kbd><p>This compiles the prelude files in <kbd>$PREFIX/share/geordi-0/prelude</kbd> to produce <kbd>$PREFIX/share/geordi-0/rt/{prelude.hpp.gch,prelude.a,libtpreload.so.0.0}</kbd>.</p>
</li>
</ol>
<p>Now try running</p><pre> sudo geordi-local "&lt;&lt; 'x'"</pre>
<p>If this complains about missing executables like <kbd>as</kbd> and <kbd>ld</kbd> which are present in a non-standard location in your <kbd>PATH</kbd>, try</p><pre> sudo env PATH=$PATH geordi-local "&lt;&lt; 'x'"</pre>
<p>If you get errors complaining about missing libraries and such (this can happen due to differing versions or configurations of gcc), try locating those on your system and manually copying them into the corresponding place in <kbd>$PREFIX/share/geordi-0/rt</kbd>.</p>
<p>If your <kbd>compile-config</kbd> points to a custom-built gcc in a non-standard location <kbd>/foo/bar</kbd> and you get an error about <kbd>/t</kbd> missing some libraries, try adding <kbd>-Wl,-rlink,/foo/bar/lib</kbd> to <kbd>LINK_FLAGS</kbd> in <kbd>compile-config</kbd>.</p>
<h3>1.4&emsp;Running the testsuite</h3>
<p>A modest testsuite can now be run with <kbd>sudo geordi-testsuite</kbd> (recommended).</p>
<hr/><h2 id='running'>2. Running geordi</h2>
<h3 id='locally'>2.1&emsp;<kbd>geordi-local</kbd></h3>
<p><kbd>geordi-local</kbd> lets one test snippets locally (that is, without connecting to any IRC server).</p>
<p>Usage:&emsp;<kbd>sudo geordi-local [option]... [request]...</kbd></p>
<p>Request syntax is described in the <a href='http://www.eelis.net/geordi/#usage'>manual</a>, except that here the nickname (and colon/comma) must be omitted.</p>
<p>Options:</p>
<dl>
<dt><kbd>-h</kbd> / <kbd>--help</kbd></dt>
<dd><p>Display help and exit.</p></dd>
</dl>
<p>If any requests are specified, they are evaluated and their results are shown. If the first request starts with a request option, interject “<kbd>--</kbd>” to prevent it from being interpreted as a command option.</p>
<p>If no requests are specified, the program goes into a Read-Eval-Print-Loop.</p>
<h3 id='ircbot'>2.2&emsp;<kbd>geordi-irc</kbd></h3>
<p>Usage:&emsp;<kbd>sudo geordi-irc [option]...</kbd></p>
<p>Starting an IRC bot with root permissions should make one seriously nervous. Geordi requires root permissions only because <a href='http://linux.die.net/man/2/chroot'>chroot(2)</a> does. Geordi chroots into <kbd>rt</kbd> as one of the first things it does on startup, and changes to the user and group specified in jail-config before it starts responding to IRC messages.</p>
<p>Options:</p>
<dl>
<dt><kbd>-c &lt;file></kbd> / <kbd>--config &lt;file></kbd></dt>
<dd><p>Load bot configuration from &lt;file> instead of <kbd>irc-config</kbd>.</p></dd>
<dt><kbd>-h</kbd> / <kbd>--help</kbd></dt>
<dd><p>Display help and exit.</p></dd>
</dl>
<h4 id='nickserv'>NickServ identification</h4>
<p>To have the bot identify to NickServ, change the following line in <kbd>irc-config</kbd>:</p>
<pre> , nick_pass = Nothing</pre>
<p>into:</p>
<pre> , nick_pass = Just "mypassword"</pre>
<h4>Nickless requests</h4>
<p>To have the bot respond to nickless requests (e.g. "<kbd>&lt;&lt; 3</kbd>") in channels #foo, #bar, and #bas, use:</p>
<pre> , allow_nickless_requests_in = ["#foo", "#bar", "#bas"]</pre>
<h4 id='reconnect'>Auto-reconnect</h4>
<p>Geordi does not auto-reconnect. For that, just use something like</p><pre> while true; do geordi-irc; sleep 120; done</pre>
<h4 id='multinetwork'>Connecting to multiple networks</h4>
<p>Make config files for the different networks. Then run one <kbd>geordi-irc</kbd> instance for each network, passing -c arguments pointing to the respective config files. The <kbd>rt</kbd> directory will be safely shared.</p>
<h4>Censoring phrases</h4>
<p>Some networks automatically kick or ban clients that utter certain phrases (like botnet commands). To prevent a geordi bot from uttering these, list regexes for them in irc-config. E.g.:</p>
<pre> , censor = ["some naughty phrase", "some wicked utterance"]</pre>
<hr/><h2 id='localization'>3. Localization</h2>
<p>To get compiler diagnostics (and some (but not all) other geordi messages) in a locale of your choice, copy the following into <kbd>rt</kbd> (preserving paths, for example using <kbd>cp --parents</kbd>):</p>
<ul>
<li>/usr/lib/locale/foo_BAR.utf8/*</li>
<li>/usr/share/locale/foo/LC_MESSAGES/{cpplib,gcc,libc,libstdc++,opcodes}.mo</li>
</ul>
<p>These paths might differ somewhat on your system.</p>
<p>You may need to install a separate GCC locales package or other kind of language pack for your distro, to get the files above.</p>
<p>Furthermore, not all of the files above may be available for your locale; copy those that are.</p>
<p>Additionally, the LC_ALL environment variable must be set to foo_BAR.utf8 when geordi is started. Note that sudo clears environment variables by default, so either use</p><pre> sudo -E geordi-...</pre><p>or use</p><pre> sudo env LC_ALL=foo_BAR.utf8 geordi-...</pre>
<hr/><h2 id='problems'>4. Known problems</h2>
<ul>
<li>
Because <kbd>geordi-irc</kbd> connects as root, IRC servers that query ident may get a root response and may decide to reject the connection. (Quakenet is known to do this.)
</li>
</ul>
</body>
</html>

About

IRC C++ eval bot

Resources

Stars

4 stars

Watchers

7 watching

Forks

Releases

Packages

Contributors

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - LearnProgramming/geordi: IRC C++ eval bot · GitHub
Skip to content

Repository files navigation

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
<head>
<title>Geordi Readme</title>
</head>
<body>
<h1>Geordi Readme</h1>
<hr/><h2>Table of Contents</h2>
<ul>
<li><a href='#installation'>1. Installation</a></li>
<li><a href='#running'>2. Running geordi</a></li>
<li><a href='#localization'>3. Localization</a></li>
<li><a href='#problems'>4. Known problems</a></li>
</ul>
<hr/><h2 id='installation'>1. Installation</h2>
<h3>1.1&emsp;Prerequisites</h3>
<ul>
<li>An i386 or x86-64 machine</li>
<li>GNU/Linux &ge; 2.6.34</li>
<li>GCC/G++ &ge; 4.6</li>
<li><a href='http://www.boost.org/'>Boost</a> &ge; 1.33 (Only the headers are needed)</li>
<li><a href='http://www.haskell.org/ghc/'>GHC</a> &ge; 7.4
<!--<p>On Ubuntu, it is highly recommended to use GHC packages from the Ubuntu repositories. Use of haskell.org's GHC packages may result in strange "g++: Virtual timer expired" errors.</p>
<p>Some distributions package GHC libraries separately. If, when compiling, you get errors like “Could not find module "Control.Monad.State"”, look for separate mtl and network packages.</p> -->
</li>
</ul>
<p>In addition, geordi depends on a number of <a href='http://hackage.haskell.org/'>Hackage</a> packages, but these will be downloaded, built, and installed automatically by <a href='http://hackage.haskell.org/trac/hackage/wiki/CabalInstall'>cabal-install</a>.</p>
<h3>1.2&emsp;Installing geordi</h3>
<p>The easiest way to build and install geordi is with <a href='http://hackage.haskell.org/trac/hackage/wiki/CabalInstall'>cabal-install</a>, part of the <a href='http://hackage.haskell.org/platform//'>Haskell Platform</a>.</p>
<p>In the geordi directory, say:</p>
<pre> cabal update
cabal install</pre>
<p>This will download, build, and install any missing dependencies from <a href='http://hackage.haskell.org/'>Hackage</a>, and will then build and install geordi (by default into <tt>$HOME/.cabal/</tt>).</p>
<h3>1.3&emsp;Setting up a chroot</h3>
<p>To set up a directory for geordi to chroot into when it starts, do the following:</p>
<ol>
<li><p>Edit <kbd>$PREFIX/share/geordi-0/compile-config</kbd> to your liking (where <kbd>$PREFIX</kbd> is the location where Cabal installed geordi, which defaults to <kbd>$HOME/.cabal/</kbd>). Check that the g++ path refers to the actual g++ binary, not some wrapper that adds output coloring or something.</p></li>
<li><p>On Debian and Ubuntu, replace</p><pre> group = "nobody"</pre><p>with</p><pre> group = "nogroup"</pre><p> in <kbd>$PREFIX/share/geordi-0/jail-config</kbd>.</p></li>
<li><kbd>geordi-mkrt</kbd><p>This creates <kbd>$PREFIX/share/geordi-0/rt</kbd>, which will be our chroot root, and copies various files into it that GCC needs in order to function.</p><p>If you ever make further modifications to <kbd>compile-config</kbd>, throw the old <kbd>rt</kbd> away and build a new one with <kbd>geordi-mkrt</kbd> (followed by <kbd>geordi-compile-prelude</kbd>).</p></li>
<li><kbd>geordi-compile-prelude</kbd><p>This compiles the prelude files in <kbd>$PREFIX/share/geordi-0/prelude</kbd> to produce <kbd>$PREFIX/share/geordi-0/rt/{prelude.hpp.gch,prelude.a,libtpreload.so.0.0}</kbd>.</p>
</li>
</ol>
<p>Now try running</p><pre> sudo geordi-local "&lt;&lt; 'x'"</pre>
<p>If this complains about missing executables like <kbd>as</kbd> and <kbd>ld</kbd> which are present in a non-standard location in your <kbd>PATH</kbd>, try</p><pre> sudo env PATH=$PATH geordi-local "&lt;&lt; 'x'"</pre>
<p>If you get errors complaining about missing libraries and such (this can happen due to differing versions or configurations of gcc), try locating those on your system and manually copying them into the corresponding place in <kbd>$PREFIX/share/geordi-0/rt</kbd>.</p>
<p>If your <kbd>compile-config</kbd> points to a custom-built gcc in a non-standard location <kbd>/foo/bar</kbd> and you get an error about <kbd>/t</kbd> missing some libraries, try adding <kbd>-Wl,-rlink,/foo/bar/lib</kbd> to <kbd>LINK_FLAGS</kbd> in <kbd>compile-config</kbd>.</p>
<h3>1.4&emsp;Running the testsuite</h3>
<p>A modest testsuite can now be run with <kbd>sudo geordi-testsuite</kbd> (recommended).</p>
<hr/><h2 id='running'>2. Running geordi</h2>
<h3 id='locally'>2.1&emsp;<kbd>geordi-local</kbd></h3>
<p><kbd>geordi-local</kbd> lets one test snippets locally (that is, without connecting to any IRC server).</p>
<p>Usage:&emsp;<kbd>sudo geordi-local [option]... [request]...</kbd></p>
<p>Request syntax is described in the <a href='http://www.eelis.net/geordi/#usage'>manual</a>, except that here the nickname (and colon/comma) must be omitted.</p>
<p>Options:</p>
<dl>
<dt><kbd>-h</kbd> / <kbd>--help</kbd></dt>
<dd><p>Display help and exit.</p></dd>
</dl>
<p>If any requests are specified, they are evaluated and their results are shown. If the first request starts with a request option, interject “<kbd>--</kbd>” to prevent it from being interpreted as a command option.</p>
<p>If no requests are specified, the program goes into a Read-Eval-Print-Loop.</p>
<h3 id='ircbot'>2.2&emsp;<kbd>geordi-irc</kbd></h3>
<p>Usage:&emsp;<kbd>sudo geordi-irc [option]...</kbd></p>
<p>Starting an IRC bot with root permissions should make one seriously nervous. Geordi requires root permissions only because <a href='http://linux.die.net/man/2/chroot'>chroot(2)</a> does. Geordi chroots into <kbd>rt</kbd> as one of the first things it does on startup, and changes to the user and group specified in jail-config before it starts responding to IRC messages.</p>
<p>Options:</p>
<dl>
<dt><kbd>-c &lt;file></kbd> / <kbd>--config &lt;file></kbd></dt>
<dd><p>Load bot configuration from &lt;file> instead of <kbd>irc-config</kbd>.</p></dd>
<dt><kbd>-h</kbd> / <kbd>--help</kbd></dt>
<dd><p>Display help and exit.</p></dd>
</dl>
<h4 id='nickserv'>NickServ identification</h4>
<p>To have the bot identify to NickServ, change the following line in <kbd>irc-config</kbd>:</p>
<pre> , nick_pass = Nothing</pre>
<p>into:</p>
<pre> , nick_pass = Just "mypassword"</pre>
<h4>Nickless requests</h4>
<p>To have the bot respond to nickless requests (e.g. "<kbd>&lt;&lt; 3</kbd>") in channels #foo, #bar, and #bas, use:</p>
<pre> , allow_nickless_requests_in = ["#foo", "#bar", "#bas"]</pre>
<h4 id='reconnect'>Auto-reconnect</h4>
<p>Geordi does not auto-reconnect. For that, just use something like</p><pre> while true; do geordi-irc; sleep 120; done</pre>
<h4 id='multinetwork'>Connecting to multiple networks</h4>
<p>Make config files for the different networks. Then run one <kbd>geordi-irc</kbd> instance for each network, passing -c arguments pointing to the respective config files. The <kbd>rt</kbd> directory will be safely shared.</p>
<h4>Censoring phrases</h4>
<p>Some networks automatically kick or ban clients that utter certain phrases (like botnet commands). To prevent a geordi bot from uttering these, list regexes for them in irc-config. E.g.:</p>
<pre> , censor = ["some naughty phrase", "some wicked utterance"]</pre>
<hr/><h2 id='localization'>3. Localization</h2>
<p>To get compiler diagnostics (and some (but not all) other geordi messages) in a locale of your choice, copy the following into <kbd>rt</kbd> (preserving paths, for example using <kbd>cp --parents</kbd>):</p>
<ul>
<li>/usr/lib/locale/foo_BAR.utf8/*</li>
<li>/usr/share/locale/foo/LC_MESSAGES/{cpplib,gcc,libc,libstdc++,opcodes}.mo</li>
</ul>
<p>These paths might differ somewhat on your system.</p>
<p>You may need to install a separate GCC locales package or other kind of language pack for your distro, to get the files above.</p>
<p>Furthermore, not all of the files above may be available for your locale; copy those that are.</p>
<p>Additionally, the LC_ALL environment variable must be set to foo_BAR.utf8 when geordi is started. Note that sudo clears environment variables by default, so either use</p><pre> sudo -E geordi-...</pre><p>or use</p><pre> sudo env LC_ALL=foo_BAR.utf8 geordi-...</pre>
<hr/><h2 id='problems'>4. Known problems</h2>
<ul>
<li>
Because <kbd>geordi-irc</kbd> connects as root, IRC servers that query ident may get a root response and may decide to reject the connection. (Quakenet is known to do this.)
</li>
</ul>
</body>
</html>

About

IRC C++ eval bot

Resources

Stars

4 stars

Watchers

7 watching

Forks

Releases

Packages

Contributors

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - LearnProgramming/geordi: IRC C++ eval bot · GitHub
Skip to content

Repository files navigation

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
<head>
<title>Geordi Readme</title>
</head>
<body>
<h1>Geordi Readme</h1>
<hr/><h2>Table of Contents</h2>
<ul>
<li><a href='#installation'>1. Installation</a></li>
<li><a href='#running'>2. Running geordi</a></li>
<li><a href='#localization'>3. Localization</a></li>
<li><a href='#problems'>4. Known problems</a></li>
</ul>
<hr/><h2 id='installation'>1. Installation</h2>
<h3>1.1&emsp;Prerequisites</h3>
<ul>
<li>An i386 or x86-64 machine</li>
<li>GNU/Linux &ge; 2.6.34</li>
<li>GCC/G++ &ge; 4.6</li>
<li><a href='http://www.boost.org/'>Boost</a> &ge; 1.33 (Only the headers are needed)</li>
<li><a href='http://www.haskell.org/ghc/'>GHC</a> &ge; 7.4
<!--<p>On Ubuntu, it is highly recommended to use GHC packages from the Ubuntu repositories. Use of haskell.org's GHC packages may result in strange "g++: Virtual timer expired" errors.</p>
<p>Some distributions package GHC libraries separately. If, when compiling, you get errors like “Could not find module "Control.Monad.State"”, look for separate mtl and network packages.</p> -->
</li>
</ul>
<p>In addition, geordi depends on a number of <a href='http://hackage.haskell.org/'>Hackage</a> packages, but these will be downloaded, built, and installed automatically by <a href='http://hackage.haskell.org/trac/hackage/wiki/CabalInstall'>cabal-install</a>.</p>
<h3>1.2&emsp;Installing geordi</h3>
<p>The easiest way to build and install geordi is with <a href='http://hackage.haskell.org/trac/hackage/wiki/CabalInstall'>cabal-install</a>, part of the <a href='http://hackage.haskell.org/platform//'>Haskell Platform</a>.</p>
<p>In the geordi directory, say:</p>
<pre> cabal update
cabal install</pre>
<p>This will download, build, and install any missing dependencies from <a href='http://hackage.haskell.org/'>Hackage</a>, and will then build and install geordi (by default into <tt>$HOME/.cabal/</tt>).</p>
<h3>1.3&emsp;Setting up a chroot</h3>
<p>To set up a directory for geordi to chroot into when it starts, do the following:</p>
<ol>
<li><p>Edit <kbd>$PREFIX/share/geordi-0/compile-config</kbd> to your liking (where <kbd>$PREFIX</kbd> is the location where Cabal installed geordi, which defaults to <kbd>$HOME/.cabal/</kbd>). Check that the g++ path refers to the actual g++ binary, not some wrapper that adds output coloring or something.</p></li>
<li><p>On Debian and Ubuntu, replace</p><pre> group = "nobody"</pre><p>with</p><pre> group = "nogroup"</pre><p> in <kbd>$PREFIX/share/geordi-0/jail-config</kbd>.</p></li>
<li><kbd>geordi-mkrt</kbd><p>This creates <kbd>$PREFIX/share/geordi-0/rt</kbd>, which will be our chroot root, and copies various files into it that GCC needs in order to function.</p><p>If you ever make further modifications to <kbd>compile-config</kbd>, throw the old <kbd>rt</kbd> away and build a new one with <kbd>geordi-mkrt</kbd> (followed by <kbd>geordi-compile-prelude</kbd>).</p></li>
<li><kbd>geordi-compile-prelude</kbd><p>This compiles the prelude files in <kbd>$PREFIX/share/geordi-0/prelude</kbd> to produce <kbd>$PREFIX/share/geordi-0/rt/{prelude.hpp.gch,prelude.a,libtpreload.so.0.0}</kbd>.</p>
</li>
</ol>
<p>Now try running</p><pre> sudo geordi-local "&lt;&lt; 'x'"</pre>
<p>If this complains about missing executables like <kbd>as</kbd> and <kbd>ld</kbd> which are present in a non-standard location in your <kbd>PATH</kbd>, try</p><pre> sudo env PATH=$PATH geordi-local "&lt;&lt; 'x'"</pre>
<p>If you get errors complaining about missing libraries and such (this can happen due to differing versions or configurations of gcc), try locating those on your system and manually copying them into the corresponding place in <kbd>$PREFIX/share/geordi-0/rt</kbd>.</p>
<p>If your <kbd>compile-config</kbd> points to a custom-built gcc in a non-standard location <kbd>/foo/bar</kbd> and you get an error about <kbd>/t</kbd> missing some libraries, try adding <kbd>-Wl,-rlink,/foo/bar/lib</kbd> to <kbd>LINK_FLAGS</kbd> in <kbd>compile-config</kbd>.</p>
<h3>1.4&emsp;Running the testsuite</h3>
<p>A modest testsuite can now be run with <kbd>sudo geordi-testsuite</kbd> (recommended).</p>
<hr/><h2 id='running'>2. Running geordi</h2>
<h3 id='locally'>2.1&emsp;<kbd>geordi-local</kbd></h3>
<p><kbd>geordi-local</kbd> lets one test snippets locally (that is, without connecting to any IRC server).</p>
<p>Usage:&emsp;<kbd>sudo geordi-local [option]... [request]...</kbd></p>
<p>Request syntax is described in the <a href='http://www.eelis.net/geordi/#usage'>manual</a>, except that here the nickname (and colon/comma) must be omitted.</p>
<p>Options:</p>
<dl>
<dt><kbd>-h</kbd> / <kbd>--help</kbd></dt>
<dd><p>Display help and exit.</p></dd>
</dl>
<p>If any requests are specified, they are evaluated and their results are shown. If the first request starts with a request option, interject “<kbd>--</kbd>” to prevent it from being interpreted as a command option.</p>
<p>If no requests are specified, the program goes into a Read-Eval-Print-Loop.</p>
<h3 id='ircbot'>2.2&emsp;<kbd>geordi-irc</kbd></h3>
<p>Usage:&emsp;<kbd>sudo geordi-irc [option]...</kbd></p>
<p>Starting an IRC bot with root permissions should make one seriously nervous. Geordi requires root permissions only because <a href='http://linux.die.net/man/2/chroot'>chroot(2)</a> does. Geordi chroots into <kbd>rt</kbd> as one of the first things it does on startup, and changes to the user and group specified in jail-config before it starts responding to IRC messages.</p>
<p>Options:</p>
<dl>
<dt><kbd>-c &lt;file></kbd> / <kbd>--config &lt;file></kbd></dt>
<dd><p>Load bot configuration from &lt;file> instead of <kbd>irc-config</kbd>.</p></dd>
<dt><kbd>-h</kbd> / <kbd>--help</kbd></dt>
<dd><p>Display help and exit.</p></dd>
</dl>
<h4 id='nickserv'>NickServ identification</h4>
<p>To have the bot identify to NickServ, change the following line in <kbd>irc-config</kbd>:</p>
<pre> , nick_pass = Nothing</pre>
<p>into:</p>
<pre> , nick_pass = Just "mypassword"</pre>
<h4>Nickless requests</h4>
<p>To have the bot respond to nickless requests (e.g. "<kbd>&lt;&lt; 3</kbd>") in channels #foo, #bar, and #bas, use:</p>
<pre> , allow_nickless_requests_in = ["#foo", "#bar", "#bas"]</pre>
<h4 id='reconnect'>Auto-reconnect</h4>
<p>Geordi does not auto-reconnect. For that, just use something like</p><pre> while true; do geordi-irc; sleep 120; done</pre>
<h4 id='multinetwork'>Connecting to multiple networks</h4>
<p>Make config files for the different networks. Then run one <kbd>geordi-irc</kbd> instance for each network, passing -c arguments pointing to the respective config files. The <kbd>rt</kbd> directory will be safely shared.</p>
<h4>Censoring phrases</h4>
<p>Some networks automatically kick or ban clients that utter certain phrases (like botnet commands). To prevent a geordi bot from uttering these, list regexes for them in irc-config. E.g.:</p>
<pre> , censor = ["some naughty phrase", "some wicked utterance"]</pre>
<hr/><h2 id='localization'>3. Localization</h2>
<p>To get compiler diagnostics (and some (but not all) other geordi messages) in a locale of your choice, copy the following into <kbd>rt</kbd> (preserving paths, for example using <kbd>cp --parents</kbd>):</p>
<ul>
<li>/usr/lib/locale/foo_BAR.utf8/*</li>
<li>/usr/share/locale/foo/LC_MESSAGES/{cpplib,gcc,libc,libstdc++,opcodes}.mo</li>
</ul>
<p>These paths might differ somewhat on your system.</p>
<p>You may need to install a separate GCC locales package or other kind of language pack for your distro, to get the files above.</p>
<p>Furthermore, not all of the files above may be available for your locale; copy those that are.</p>
<p>Additionally, the LC_ALL environment variable must be set to foo_BAR.utf8 when geordi is started. Note that sudo clears environment variables by default, so either use</p><pre> sudo -E geordi-...</pre><p>or use</p><pre> sudo env LC_ALL=foo_BAR.utf8 geordi-...</pre>
<hr/><h2 id='problems'>4. Known problems</h2>
<ul>
<li>
Because <kbd>geordi-irc</kbd> connects as root, IRC servers that query ident may get a root response and may decide to reject the connection. (Quakenet is known to do this.)
</li>
</ul>
</body>
</html>

About

IRC C++ eval bot

Resources

Stars

4 stars

Watchers

7 watching

Forks

Releases

Packages

Contributors

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' GitHub - LearnProgramming/geordi: IRC C++ eval bot · GitHub
Skip to content

Repository files navigation

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
<head>
<title>Geordi Readme</title>
</head>
<body>
<h1>Geordi Readme</h1>
<hr/><h2>Table of Contents</h2>
<ul>
<li><a href='#installation'>1. Installation</a></li>
<li><a href='#running'>2. Running geordi</a></li>
<li><a href='#localization'>3. Localization</a></li>
<li><a href='#problems'>4. Known problems</a></li>
</ul>
<hr/><h2 id='installation'>1. Installation</h2>
<h3>1.1&emsp;Prerequisites</h3>
<ul>
<li>An i386 or x86-64 machine</li>
<li>GNU/Linux &ge; 2.6.34</li>
<li>GCC/G++ &ge; 4.6</li>
<li><a href='http://www.boost.org/'>Boost</a> &ge; 1.33 (Only the headers are needed)</li>
<li><a href='http://www.haskell.org/ghc/'>GHC</a> &ge; 7.4
<!--<p>On Ubuntu, it is highly recommended to use GHC packages from the Ubuntu repositories. Use of haskell.org's GHC packages may result in strange "g++: Virtual timer expired" errors.</p>
<p>Some distributions package GHC libraries separately. If, when compiling, you get errors like “Could not find module "Control.Monad.State"”, look for separate mtl and network packages.</p> -->
</li>
</ul>
<p>In addition, geordi depends on a number of <a href='http://hackage.haskell.org/'>Hackage</a> packages, but these will be downloaded, built, and installed automatically by <a href='http://hackage.haskell.org/trac/hackage/wiki/CabalInstall'>cabal-install</a>.</p>
<h3>1.2&emsp;Installing geordi</h3>
<p>The easiest way to build and install geordi is with <a href='http://hackage.haskell.org/trac/hackage/wiki/CabalInstall'>cabal-install</a>, part of the <a href='http://hackage.haskell.org/platform//'>Haskell Platform</a>.</p>
<p>In the geordi directory, say:</p>
<pre> cabal update
cabal install</pre>
<p>This will download, build, and install any missing dependencies from <a href='http://hackage.haskell.org/'>Hackage</a>, and will then build and install geordi (by default into <tt>$HOME/.cabal/</tt>).</p>
<h3>1.3&emsp;Setting up a chroot</h3>
<p>To set up a directory for geordi to chroot into when it starts, do the following:</p>
<ol>
<li><p>Edit <kbd>$PREFIX/share/geordi-0/compile-config</kbd> to your liking (where <kbd>$PREFIX</kbd> is the location where Cabal installed geordi, which defaults to <kbd>$HOME/.cabal/</kbd>). Check that the g++ path refers to the actual g++ binary, not some wrapper that adds output coloring or something.</p></li>
<li><p>On Debian and Ubuntu, replace</p><pre> group = "nobody"</pre><p>with</p><pre> group = "nogroup"</pre><p> in <kbd>$PREFIX/share/geordi-0/jail-config</kbd>.</p></li>
<li><kbd>geordi-mkrt</kbd><p>This creates <kbd>$PREFIX/share/geordi-0/rt</kbd>, which will be our chroot root, and copies various files into it that GCC needs in order to function.</p><p>If you ever make further modifications to <kbd>compile-config</kbd>, throw the old <kbd>rt</kbd> away and build a new one with <kbd>geordi-mkrt</kbd> (followed by <kbd>geordi-compile-prelude</kbd>).</p></li>
<li><kbd>geordi-compile-prelude</kbd><p>This compiles the prelude files in <kbd>$PREFIX/share/geordi-0/prelude</kbd> to produce <kbd>$PREFIX/share/geordi-0/rt/{prelude.hpp.gch,prelude.a,libtpreload.so.0.0}</kbd>.</p>
</li>
</ol>
<p>Now try running</p><pre> sudo geordi-local "&lt;&lt; 'x'"</pre>
<p>If this complains about missing executables like <kbd>as</kbd> and <kbd>ld</kbd> which are present in a non-standard location in your <kbd>PATH</kbd>, try</p><pre> sudo env PATH=$PATH geordi-local "&lt;&lt; 'x'"</pre>
<p>If you get errors complaining about missing libraries and such (this can happen due to differing versions or configurations of gcc), try locating those on your system and manually copying them into the corresponding place in <kbd>$PREFIX/share/geordi-0/rt</kbd>.</p>
<p>If your <kbd>compile-config</kbd> points to a custom-built gcc in a non-standard location <kbd>/foo/bar</kbd> and you get an error about <kbd>/t</kbd> missing some libraries, try adding <kbd>-Wl,-rlink,/foo/bar/lib</kbd> to <kbd>LINK_FLAGS</kbd> in <kbd>compile-config</kbd>.</p>
<h3>1.4&emsp;Running the testsuite</h3>
<p>A modest testsuite can now be run with <kbd>sudo geordi-testsuite</kbd> (recommended).</p>
<hr/><h2 id='running'>2. Running geordi</h2>
<h3 id='locally'>2.1&emsp;<kbd>geordi-local</kbd></h3>
<p><kbd>geordi-local</kbd> lets one test snippets locally (that is, without connecting to any IRC server).</p>
<p>Usage:&emsp;<kbd>sudo geordi-local [option]... [request]...</kbd></p>
<p>Request syntax is described in the <a href='http://www.eelis.net/geordi/#usage'>manual</a>, except that here the nickname (and colon/comma) must be omitted.</p>
<p>Options:</p>
<dl>
<dt><kbd>-h</kbd> / <kbd>--help</kbd></dt>
<dd><p>Display help and exit.</p></dd>
</dl>
<p>If any requests are specified, they are evaluated and their results are shown. If the first request starts with a request option, interject “<kbd>--</kbd>” to prevent it from being interpreted as a command option.</p>
<p>If no requests are specified, the program goes into a Read-Eval-Print-Loop.</p>
<h3 id='ircbot'>2.2&emsp;<kbd>geordi-irc</kbd></h3>
<p>Usage:&emsp;<kbd>sudo geordi-irc [option]...</kbd></p>
<p>Starting an IRC bot with root permissions should make one seriously nervous. Geordi requires root permissions only because <a href='http://linux.die.net/man/2/chroot'>chroot(2)</a> does. Geordi chroots into <kbd>rt</kbd> as one of the first things it does on startup, and changes to the user and group specified in jail-config before it starts responding to IRC messages.</p>
<p>Options:</p>
<dl>
<dt><kbd>-c &lt;file></kbd> / <kbd>--config &lt;file></kbd></dt>
<dd><p>Load bot configuration from &lt;file> instead of <kbd>irc-config</kbd>.</p></dd>
<dt><kbd>-h</kbd> / <kbd>--help</kbd></dt>
<dd><p>Display help and exit.</p></dd>
</dl>
<h4 id='nickserv'>NickServ identification</h4>
<p>To have the bot identify to NickServ, change the following line in <kbd>irc-config</kbd>:</p>
<pre> , nick_pass = Nothing</pre>
<p>into:</p>
<pre> , nick_pass = Just "mypassword"</pre>
<h4>Nickless requests</h4>
<p>To have the bot respond to nickless requests (e.g. "<kbd>&lt;&lt; 3</kbd>") in channels #foo, #bar, and #bas, use:</p>
<pre> , allow_nickless_requests_in = ["#foo", "#bar", "#bas"]</pre>
<h4 id='reconnect'>Auto-reconnect</h4>
<p>Geordi does not auto-reconnect. For that, just use something like</p><pre> while true; do geordi-irc; sleep 120; done</pre>
<h4 id='multinetwork'>Connecting to multiple networks</h4>
<p>Make config files for the different networks. Then run one <kbd>geordi-irc</kbd> instance for each network, passing -c arguments pointing to the respective config files. The <kbd>rt</kbd> directory will be safely shared.</p>
<h4>Censoring phrases</h4>
<p>Some networks automatically kick or ban clients that utter certain phrases (like botnet commands). To prevent a geordi bot from uttering these, list regexes for them in irc-config. E.g.:</p>
<pre> , censor = ["some naughty phrase", "some wicked utterance"]</pre>
<hr/><h2 id='localization'>3. Localization</h2>
<p>To get compiler diagnostics (and some (but not all) other geordi messages) in a locale of your choice, copy the following into <kbd>rt</kbd> (preserving paths, for example using <kbd>cp --parents</kbd>):</p>
<ul>
<li>/usr/lib/locale/foo_BAR.utf8/*</li>
<li>/usr/share/locale/foo/LC_MESSAGES/{cpplib,gcc,libc,libstdc++,opcodes}.mo</li>
</ul>
<p>These paths might differ somewhat on your system.</p>
<p>You may need to install a separate GCC locales package or other kind of language pack for your distro, to get the files above.</p>
<p>Furthermore, not all of the files above may be available for your locale; copy those that are.</p>
<p>Additionally, the LC_ALL environment variable must be set to foo_BAR.utf8 when geordi is started. Note that sudo clears environment variables by default, so either use</p><pre> sudo -E geordi-...</pre><p>or use</p><pre> sudo env LC_ALL=foo_BAR.utf8 geordi-...</pre>
<hr/><h2 id='problems'>4. Known problems</h2>
<ul>
<li>
Because <kbd>geordi-irc</kbd> connects as root, IRC servers that query ident may get a root response and may decide to reject the connection. (Quakenet is known to do this.)
</li>
</ul>
</body>
</html>

About

IRC C++ eval bot

Resources

Stars

4 stars

Watchers

7 watching

Forks

Releases

Packages

Contributors

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - LearnProgramming/geordi: IRC C++ eval bot · GitHub
Skip to content

Repository files navigation

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
<head>
<title>Geordi Readme</title>
</head>
<body>
<h1>Geordi Readme</h1>
<hr/><h2>Table of Contents</h2>
<ul>
<li><a href='#installation'>1. Installation</a></li>
<li><a href='#running'>2. Running geordi</a></li>
<li><a href='#localization'>3. Localization</a></li>
<li><a href='#problems'>4. Known problems</a></li>
</ul>
<hr/><h2 id='installation'>1. Installation</h2>
<h3>1.1&emsp;Prerequisites</h3>
<ul>
<li>An i386 or x86-64 machine</li>
<li>GNU/Linux &ge; 2.6.34</li>
<li>GCC/G++ &ge; 4.6</li>
<li><a href='http://www.boost.org/'>Boost</a> &ge; 1.33 (Only the headers are needed)</li>
<li><a href='http://www.haskell.org/ghc/'>GHC</a> &ge; 7.4
<!--<p>On Ubuntu, it is highly recommended to use GHC packages from the Ubuntu repositories. Use of haskell.org's GHC packages may result in strange "g++: Virtual timer expired" errors.</p>
<p>Some distributions package GHC libraries separately. If, when compiling, you get errors like “Could not find module "Control.Monad.State"”, look for separate mtl and network packages.</p> -->
</li>
</ul>
<p>In addition, geordi depends on a number of <a href='http://hackage.haskell.org/'>Hackage</a> packages, but these will be downloaded, built, and installed automatically by <a href='http://hackage.haskell.org/trac/hackage/wiki/CabalInstall'>cabal-install</a>.</p>
<h3>1.2&emsp;Installing geordi</h3>
<p>The easiest way to build and install geordi is with <a href='http://hackage.haskell.org/trac/hackage/wiki/CabalInstall'>cabal-install</a>, part of the <a href='http://hackage.haskell.org/platform//'>Haskell Platform</a>.</p>
<p>In the geordi directory, say:</p>
<pre> cabal update
cabal install</pre>
<p>This will download, build, and install any missing dependencies from <a href='http://hackage.haskell.org/'>Hackage</a>, and will then build and install geordi (by default into <tt>$HOME/.cabal/</tt>).</p>
<h3>1.3&emsp;Setting up a chroot</h3>
<p>To set up a directory for geordi to chroot into when it starts, do the following:</p>
<ol>
<li><p>Edit <kbd>$PREFIX/share/geordi-0/compile-config</kbd> to your liking (where <kbd>$PREFIX</kbd> is the location where Cabal installed geordi, which defaults to <kbd>$HOME/.cabal/</kbd>). Check that the g++ path refers to the actual g++ binary, not some wrapper that adds output coloring or something.</p></li>
<li><p>On Debian and Ubuntu, replace</p><pre> group = "nobody"</pre><p>with</p><pre> group = "nogroup"</pre><p> in <kbd>$PREFIX/share/geordi-0/jail-config</kbd>.</p></li>
<li><kbd>geordi-mkrt</kbd><p>This creates <kbd>$PREFIX/share/geordi-0/rt</kbd>, which will be our chroot root, and copies various files into it that GCC needs in order to function.</p><p>If you ever make further modifications to <kbd>compile-config</kbd>, throw the old <kbd>rt</kbd> away and build a new one with <kbd>geordi-mkrt</kbd> (followed by <kbd>geordi-compile-prelude</kbd>).</p></li>
<li><kbd>geordi-compile-prelude</kbd><p>This compiles the prelude files in <kbd>$PREFIX/share/geordi-0/prelude</kbd> to produce <kbd>$PREFIX/share/geordi-0/rt/{prelude.hpp.gch,prelude.a,libtpreload.so.0.0}</kbd>.</p>
</li>
</ol>
<p>Now try running</p><pre> sudo geordi-local "&lt;&lt; 'x'"</pre>
<p>If this complains about missing executables like <kbd>as</kbd> and <kbd>ld</kbd> which are present in a non-standard location in your <kbd>PATH</kbd>, try</p><pre> sudo env PATH=$PATH geordi-local "&lt;&lt; 'x'"</pre>
<p>If you get errors complaining about missing libraries and such (this can happen due to differing versions or configurations of gcc), try locating those on your system and manually copying them into the corresponding place in <kbd>$PREFIX/share/geordi-0/rt</kbd>.</p>
<p>If your <kbd>compile-config</kbd> points to a custom-built gcc in a non-standard location <kbd>/foo/bar</kbd> and you get an error about <kbd>/t</kbd> missing some libraries, try adding <kbd>-Wl,-rlink,/foo/bar/lib</kbd> to <kbd>LINK_FLAGS</kbd> in <kbd>compile-config</kbd>.</p>
<h3>1.4&emsp;Running the testsuite</h3>
<p>A modest testsuite can now be run with <kbd>sudo geordi-testsuite</kbd> (recommended).</p>
<hr/><h2 id='running'>2. Running geordi</h2>
<h3 id='locally'>2.1&emsp;<kbd>geordi-local</kbd></h3>
<p><kbd>geordi-local</kbd> lets one test snippets locally (that is, without connecting to any IRC server).</p>
<p>Usage:&emsp;<kbd>sudo geordi-local [option]... [request]...</kbd></p>
<p>Request syntax is described in the <a href='http://www.eelis.net/geordi/#usage'>manual</a>, except that here the nickname (and colon/comma) must be omitted.</p>
<p>Options:</p>
<dl>
<dt><kbd>-h</kbd> / <kbd>--help</kbd></dt>
<dd><p>Display help and exit.</p></dd>
</dl>
<p>If any requests are specified, they are evaluated and their results are shown. If the first request starts with a request option, interject “<kbd>--</kbd>” to prevent it from being interpreted as a command option.</p>
<p>If no requests are specified, the program goes into a Read-Eval-Print-Loop.</p>
<h3 id='ircbot'>2.2&emsp;<kbd>geordi-irc</kbd></h3>
<p>Usage:&emsp;<kbd>sudo geordi-irc [option]...</kbd></p>
<p>Starting an IRC bot with root permissions should make one seriously nervous. Geordi requires root permissions only because <a href='http://linux.die.net/man/2/chroot'>chroot(2)</a> does. Geordi chroots into <kbd>rt</kbd> as one of the first things it does on startup, and changes to the user and group specified in jail-config before it starts responding to IRC messages.</p>
<p>Options:</p>
<dl>
<dt><kbd>-c &lt;file></kbd> / <kbd>--config &lt;file></kbd></dt>
<dd><p>Load bot configuration from &lt;file> instead of <kbd>irc-config</kbd>.</p></dd>
<dt><kbd>-h</kbd> / <kbd>--help</kbd></dt>
<dd><p>Display help and exit.</p></dd>
</dl>
<h4 id='nickserv'>NickServ identification</h4>
<p>To have the bot identify to NickServ, change the following line in <kbd>irc-config</kbd>:</p>
<pre> , nick_pass = Nothing</pre>
<p>into:</p>
<pre> , nick_pass = Just "mypassword"</pre>
<h4>Nickless requests</h4>
<p>To have the bot respond to nickless requests (e.g. "<kbd>&lt;&lt; 3</kbd>") in channels #foo, #bar, and #bas, use:</p>
<pre> , allow_nickless_requests_in = ["#foo", "#bar", "#bas"]</pre>
<h4 id='reconnect'>Auto-reconnect</h4>
<p>Geordi does not auto-reconnect. For that, just use something like</p><pre> while true; do geordi-irc; sleep 120; done</pre>
<h4 id='multinetwork'>Connecting to multiple networks</h4>
<p>Make config files for the different networks. Then run one <kbd>geordi-irc</kbd> instance for each network, passing -c arguments pointing to the respective config files. The <kbd>rt</kbd> directory will be safely shared.</p>
<h4>Censoring phrases</h4>
<p>Some networks automatically kick or ban clients that utter certain phrases (like botnet commands). To prevent a geordi bot from uttering these, list regexes for them in irc-config. E.g.:</p>
<pre> , censor = ["some naughty phrase", "some wicked utterance"]</pre>
<hr/><h2 id='localization'>3. Localization</h2>
<p>To get compiler diagnostics (and some (but not all) other geordi messages) in a locale of your choice, copy the following into <kbd>rt</kbd> (preserving paths, for example using <kbd>cp --parents</kbd>):</p>
<ul>
<li>/usr/lib/locale/foo_BAR.utf8/*</li>
<li>/usr/share/locale/foo/LC_MESSAGES/{cpplib,gcc,libc,libstdc++,opcodes}.mo</li>
</ul>
<p>These paths might differ somewhat on your system.</p>
<p>You may need to install a separate GCC locales package or other kind of language pack for your distro, to get the files above.</p>
<p>Furthermore, not all of the files above may be available for your locale; copy those that are.</p>
<p>Additionally, the LC_ALL environment variable must be set to foo_BAR.utf8 when geordi is started. Note that sudo clears environment variables by default, so either use</p><pre> sudo -E geordi-...</pre><p>or use</p><pre> sudo env LC_ALL=foo_BAR.utf8 geordi-...</pre>
<hr/><h2 id='problems'>4. Known problems</h2>
<ul>
<li>
Because <kbd>geordi-irc</kbd> connects as root, IRC servers that query ident may get a root response and may decide to reject the connection. (Quakenet is known to do this.)
</li>
</ul>
</body>
</html>

About

IRC C++ eval bot

Resources

Stars

4 stars

Watchers

7 watching

Forks

Releases

Packages

Contributors

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - LearnProgramming/geordi: IRC C++ eval bot · GitHub
Skip to content

Repository files navigation

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
<head>
<title>Geordi Readme</title>
</head>
<body>
<h1>Geordi Readme</h1>
<hr/><h2>Table of Contents</h2>
<ul>
<li><a href='#installation'>1. Installation</a></li>
<li><a href='#running'>2. Running geordi</a></li>
<li><a href='#localization'>3. Localization</a></li>
<li><a href='#problems'>4. Known problems</a></li>
</ul>
<hr/><h2 id='installation'>1. Installation</h2>
<h3>1.1&emsp;Prerequisites</h3>
<ul>
<li>An i386 or x86-64 machine</li>
<li>GNU/Linux &ge; 2.6.34</li>
<li>GCC/G++ &ge; 4.6</li>
<li><a href='http://www.boost.org/'>Boost</a> &ge; 1.33 (Only the headers are needed)</li>
<li><a href='http://www.haskell.org/ghc/'>GHC</a> &ge; 7.4
<!--<p>On Ubuntu, it is highly recommended to use GHC packages from the Ubuntu repositories. Use of haskell.org's GHC packages may result in strange "g++: Virtual timer expired" errors.</p>
<p>Some distributions package GHC libraries separately. If, when compiling, you get errors like “Could not find module "Control.Monad.State"”, look for separate mtl and network packages.</p> -->
</li>
</ul>
<p>In addition, geordi depends on a number of <a href='http://hackage.haskell.org/'>Hackage</a> packages, but these will be downloaded, built, and installed automatically by <a href='http://hackage.haskell.org/trac/hackage/wiki/CabalInstall'>cabal-install</a>.</p>
<h3>1.2&emsp;Installing geordi</h3>
<p>The easiest way to build and install geordi is with <a href='http://hackage.haskell.org/trac/hackage/wiki/CabalInstall'>cabal-install</a>, part of the <a href='http://hackage.haskell.org/platform//'>Haskell Platform</a>.</p>
<p>In the geordi directory, say:</p>
<pre> cabal update
cabal install</pre>
<p>This will download, build, and install any missing dependencies from <a href='http://hackage.haskell.org/'>Hackage</a>, and will then build and install geordi (by default into <tt>$HOME/.cabal/</tt>).</p>
<h3>1.3&emsp;Setting up a chroot</h3>
<p>To set up a directory for geordi to chroot into when it starts, do the following:</p>
<ol>
<li><p>Edit <kbd>$PREFIX/share/geordi-0/compile-config</kbd> to your liking (where <kbd>$PREFIX</kbd> is the location where Cabal installed geordi, which defaults to <kbd>$HOME/.cabal/</kbd>). Check that the g++ path refers to the actual g++ binary, not some wrapper that adds output coloring or something.</p></li>
<li><p>On Debian and Ubuntu, replace</p><pre> group = "nobody"</pre><p>with</p><pre> group = "nogroup"</pre><p> in <kbd>$PREFIX/share/geordi-0/jail-config</kbd>.</p></li>
<li><kbd>geordi-mkrt</kbd><p>This creates <kbd>$PREFIX/share/geordi-0/rt</kbd>, which will be our chroot root, and copies various files into it that GCC needs in order to function.</p><p>If you ever make further modifications to <kbd>compile-config</kbd>, throw the old <kbd>rt</kbd> away and build a new one with <kbd>geordi-mkrt</kbd> (followed by <kbd>geordi-compile-prelude</kbd>).</p></li>
<li><kbd>geordi-compile-prelude</kbd><p>This compiles the prelude files in <kbd>$PREFIX/share/geordi-0/prelude</kbd> to produce <kbd>$PREFIX/share/geordi-0/rt/{prelude.hpp.gch,prelude.a,libtpreload.so.0.0}</kbd>.</p>
</li>
</ol>
<p>Now try running</p><pre> sudo geordi-local "&lt;&lt; 'x'"</pre>
<p>If this complains about missing executables like <kbd>as</kbd> and <kbd>ld</kbd> which are present in a non-standard location in your <kbd>PATH</kbd>, try</p><pre> sudo env PATH=$PATH geordi-local "&lt;&lt; 'x'"</pre>
<p>If you get errors complaining about missing libraries and such (this can happen due to differing versions or configurations of gcc), try locating those on your system and manually copying them into the corresponding place in <kbd>$PREFIX/share/geordi-0/rt</kbd>.</p>
<p>If your <kbd>compile-config</kbd> points to a custom-built gcc in a non-standard location <kbd>/foo/bar</kbd> and you get an error about <kbd>/t</kbd> missing some libraries, try adding <kbd>-Wl,-rlink,/foo/bar/lib</kbd> to <kbd>LINK_FLAGS</kbd> in <kbd>compile-config</kbd>.</p>
<h3>1.4&emsp;Running the testsuite</h3>
<p>A modest testsuite can now be run with <kbd>sudo geordi-testsuite</kbd> (recommended).</p>
<hr/><h2 id='running'>2. Running geordi</h2>
<h3 id='locally'>2.1&emsp;<kbd>geordi-local</kbd></h3>
<p><kbd>geordi-local</kbd> lets one test snippets locally (that is, without connecting to any IRC server).</p>
<p>Usage:&emsp;<kbd>sudo geordi-local [option]... [request]...</kbd></p>
<p>Request syntax is described in the <a href='http://www.eelis.net/geordi/#usage'>manual</a>, except that here the nickname (and colon/comma) must be omitted.</p>
<p>Options:</p>
<dl>
<dt><kbd>-h</kbd> / <kbd>--help</kbd></dt>
<dd><p>Display help and exit.</p></dd>
</dl>
<p>If any requests are specified, they are evaluated and their results are shown. If the first request starts with a request option, interject “<kbd>--</kbd>” to prevent it from being interpreted as a command option.</p>
<p>If no requests are specified, the program goes into a Read-Eval-Print-Loop.</p>
<h3 id='ircbot'>2.2&emsp;<kbd>geordi-irc</kbd></h3>
<p>Usage:&emsp;<kbd>sudo geordi-irc [option]...</kbd></p>
<p>Starting an IRC bot with root permissions should make one seriously nervous. Geordi requires root permissions only because <a href='http://linux.die.net/man/2/chroot'>chroot(2)</a> does. Geordi chroots into <kbd>rt</kbd> as one of the first things it does on startup, and changes to the user and group specified in jail-config before it starts responding to IRC messages.</p>
<p>Options:</p>
<dl>
<dt><kbd>-c &lt;file></kbd> / <kbd>--config &lt;file></kbd></dt>
<dd><p>Load bot configuration from &lt;file> instead of <kbd>irc-config</kbd>.</p></dd>
<dt><kbd>-h</kbd> / <kbd>--help</kbd></dt>
<dd><p>Display help and exit.</p></dd>
</dl>
<h4 id='nickserv'>NickServ identification</h4>
<p>To have the bot identify to NickServ, change the following line in <kbd>irc-config</kbd>:</p>
<pre> , nick_pass = Nothing</pre>
<p>into:</p>
<pre> , nick_pass = Just "mypassword"</pre>
<h4>Nickless requests</h4>
<p>To have the bot respond to nickless requests (e.g. "<kbd>&lt;&lt; 3</kbd>") in channels #foo, #bar, and #bas, use:</p>
<pre> , allow_nickless_requests_in = ["#foo", "#bar", "#bas"]</pre>
<h4 id='reconnect'>Auto-reconnect</h4>
<p>Geordi does not auto-reconnect. For that, just use something like</p><pre> while true; do geordi-irc; sleep 120; done</pre>
<h4 id='multinetwork'>Connecting to multiple networks</h4>
<p>Make config files for the different networks. Then run one <kbd>geordi-irc</kbd> instance for each network, passing -c arguments pointing to the respective config files. The <kbd>rt</kbd> directory will be safely shared.</p>
<h4>Censoring phrases</h4>
<p>Some networks automatically kick or ban clients that utter certain phrases (like botnet commands). To prevent a geordi bot from uttering these, list regexes for them in irc-config. E.g.:</p>
<pre> , censor = ["some naughty phrase", "some wicked utterance"]</pre>
<hr/><h2 id='localization'>3. Localization</h2>
<p>To get compiler diagnostics (and some (but not all) other geordi messages) in a locale of your choice, copy the following into <kbd>rt</kbd> (preserving paths, for example using <kbd>cp --parents</kbd>):</p>
<ul>
<li>/usr/lib/locale/foo_BAR.utf8/*</li>
<li>/usr/share/locale/foo/LC_MESSAGES/{cpplib,gcc,libc,libstdc++,opcodes}.mo</li>
</ul>
<p>These paths might differ somewhat on your system.</p>
<p>You may need to install a separate GCC locales package or other kind of language pack for your distro, to get the files above.</p>
<p>Furthermore, not all of the files above may be available for your locale; copy those that are.</p>
<p>Additionally, the LC_ALL environment variable must be set to foo_BAR.utf8 when geordi is started. Note that sudo clears environment variables by default, so either use</p><pre> sudo -E geordi-...</pre><p>or use</p><pre> sudo env LC_ALL=foo_BAR.utf8 geordi-...</pre>
<hr/><h2 id='problems'>4. Known problems</h2>
<ul>
<li>
Because <kbd>geordi-irc</kbd> connects as root, IRC servers that query ident may get a root response and may decide to reject the connection. (Quakenet is known to do this.)
</li>
</ul>
</body>
</html>

About

IRC C++ eval bot

Resources

Stars

4 stars

Watchers

7 watching

Forks

Releases

Packages

Contributors

, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); GitHub - LearnProgramming/geordi: IRC C++ eval bot · GitHub
Skip to content

Repository files navigation

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
<head>
<title>Geordi Readme</title>
</head>
<body>
<h1>Geordi Readme</h1>
<hr/><h2>Table of Contents</h2>
<ul>
<li><a href='#installation'>1. Installation</a></li>
<li><a href='#running'>2. Running geordi</a></li>
<li><a href='#localization'>3. Localization</a></li>
<li><a href='#problems'>4. Known problems</a></li>
</ul>
<hr/><h2 id='installation'>1. Installation</h2>
<h3>1.1&emsp;Prerequisites</h3>
<ul>
<li>An i386 or x86-64 machine</li>
<li>GNU/Linux &ge; 2.6.34</li>
<li>GCC/G++ &ge; 4.6</li>
<li><a href='http://www.boost.org/'>Boost</a> &ge; 1.33 (Only the headers are needed)</li>
<li><a href='http://www.haskell.org/ghc/'>GHC</a> &ge; 7.4
<!--<p>On Ubuntu, it is highly recommended to use GHC packages from the Ubuntu repositories. Use of haskell.org's GHC packages may result in strange "g++: Virtual timer expired" errors.</p>
<p>Some distributions package GHC libraries separately. If, when compiling, you get errors like “Could not find module "Control.Monad.State"”, look for separate mtl and network packages.</p> -->
</li>
</ul>
<p>In addition, geordi depends on a number of <a href='http://hackage.haskell.org/'>Hackage</a> packages, but these will be downloaded, built, and installed automatically by <a href='http://hackage.haskell.org/trac/hackage/wiki/CabalInstall'>cabal-install</a>.</p>
<h3>1.2&emsp;Installing geordi</h3>
<p>The easiest way to build and install geordi is with <a href='http://hackage.haskell.org/trac/hackage/wiki/CabalInstall'>cabal-install</a>, part of the <a href='http://hackage.haskell.org/platform//'>Haskell Platform</a>.</p>
<p>In the geordi directory, say:</p>
<pre> cabal update
cabal install</pre>
<p>This will download, build, and install any missing dependencies from <a href='http://hackage.haskell.org/'>Hackage</a>, and will then build and install geordi (by default into <tt>$HOME/.cabal/</tt>).</p>
<h3>1.3&emsp;Setting up a chroot</h3>
<p>To set up a directory for geordi to chroot into when it starts, do the following:</p>
<ol>
<li><p>Edit <kbd>$PREFIX/share/geordi-0/compile-config</kbd> to your liking (where <kbd>$PREFIX</kbd> is the location where Cabal installed geordi, which defaults to <kbd>$HOME/.cabal/</kbd>). Check that the g++ path refers to the actual g++ binary, not some wrapper that adds output coloring or something.</p></li>
<li><p>On Debian and Ubuntu, replace</p><pre> group = "nobody"</pre><p>with</p><pre> group = "nogroup"</pre><p> in <kbd>$PREFIX/share/geordi-0/jail-config</kbd>.</p></li>
<li><kbd>geordi-mkrt</kbd><p>This creates <kbd>$PREFIX/share/geordi-0/rt</kbd>, which will be our chroot root, and copies various files into it that GCC needs in order to function.</p><p>If you ever make further modifications to <kbd>compile-config</kbd>, throw the old <kbd>rt</kbd> away and build a new one with <kbd>geordi-mkrt</kbd> (followed by <kbd>geordi-compile-prelude</kbd>).</p></li>
<li><kbd>geordi-compile-prelude</kbd><p>This compiles the prelude files in <kbd>$PREFIX/share/geordi-0/prelude</kbd> to produce <kbd>$PREFIX/share/geordi-0/rt/{prelude.hpp.gch,prelude.a,libtpreload.so.0.0}</kbd>.</p>
</li>
</ol>
<p>Now try running</p><pre> sudo geordi-local "&lt;&lt; 'x'"</pre>
<p>If this complains about missing executables like <kbd>as</kbd> and <kbd>ld</kbd> which are present in a non-standard location in your <kbd>PATH</kbd>, try</p><pre> sudo env PATH=$PATH geordi-local "&lt;&lt; 'x'"</pre>
<p>If you get errors complaining about missing libraries and such (this can happen due to differing versions or configurations of gcc), try locating those on your system and manually copying them into the corresponding place in <kbd>$PREFIX/share/geordi-0/rt</kbd>.</p>
<p>If your <kbd>compile-config</kbd> points to a custom-built gcc in a non-standard location <kbd>/foo/bar</kbd> and you get an error about <kbd>/t</kbd> missing some libraries, try adding <kbd>-Wl,-rlink,/foo/bar/lib</kbd> to <kbd>LINK_FLAGS</kbd> in <kbd>compile-config</kbd>.</p>
<h3>1.4&emsp;Running the testsuite</h3>
<p>A modest testsuite can now be run with <kbd>sudo geordi-testsuite</kbd> (recommended).</p>
<hr/><h2 id='running'>2. Running geordi</h2>
<h3 id='locally'>2.1&emsp;<kbd>geordi-local</kbd></h3>
<p><kbd>geordi-local</kbd> lets one test snippets locally (that is, without connecting to any IRC server).</p>
<p>Usage:&emsp;<kbd>sudo geordi-local [option]... [request]...</kbd></p>
<p>Request syntax is described in the <a href='http://www.eelis.net/geordi/#usage'>manual</a>, except that here the nickname (and colon/comma) must be omitted.</p>
<p>Options:</p>
<dl>
<dt><kbd>-h</kbd> / <kbd>--help</kbd></dt>
<dd><p>Display help and exit.</p></dd>
</dl>
<p>If any requests are specified, they are evaluated and their results are shown. If the first request starts with a request option, interject “<kbd>--</kbd>” to prevent it from being interpreted as a command option.</p>
<p>If no requests are specified, the program goes into a Read-Eval-Print-Loop.</p>
<h3 id='ircbot'>2.2&emsp;<kbd>geordi-irc</kbd></h3>
<p>Usage:&emsp;<kbd>sudo geordi-irc [option]...</kbd></p>
<p>Starting an IRC bot with root permissions should make one seriously nervous. Geordi requires root permissions only because <a href='http://linux.die.net/man/2/chroot'>chroot(2)</a> does. Geordi chroots into <kbd>rt</kbd> as one of the first things it does on startup, and changes to the user and group specified in jail-config before it starts responding to IRC messages.</p>
<p>Options:</p>
<dl>
<dt><kbd>-c &lt;file></kbd> / <kbd>--config &lt;file></kbd></dt>
<dd><p>Load bot configuration from &lt;file> instead of <kbd>irc-config</kbd>.</p></dd>
<dt><kbd>-h</kbd> / <kbd>--help</kbd></dt>
<dd><p>Display help and exit.</p></dd>
</dl>
<h4 id='nickserv'>NickServ identification</h4>
<p>To have the bot identify to NickServ, change the following line in <kbd>irc-config</kbd>:</p>
<pre> , nick_pass = Nothing</pre>
<p>into:</p>
<pre> , nick_pass = Just "mypassword"</pre>
<h4>Nickless requests</h4>
<p>To have the bot respond to nickless requests (e.g. "<kbd>&lt;&lt; 3</kbd>") in channels #foo, #bar, and #bas, use:</p>
<pre> , allow_nickless_requests_in = ["#foo", "#bar", "#bas"]</pre>
<h4 id='reconnect'>Auto-reconnect</h4>
<p>Geordi does not auto-reconnect. For that, just use something like</p><pre> while true; do geordi-irc; sleep 120; done</pre>
<h4 id='multinetwork'>Connecting to multiple networks</h4>
<p>Make config files for the different networks. Then run one <kbd>geordi-irc</kbd> instance for each network, passing -c arguments pointing to the respective config files. The <kbd>rt</kbd> directory will be safely shared.</p>
<h4>Censoring phrases</h4>
<p>Some networks automatically kick or ban clients that utter certain phrases (like botnet commands). To prevent a geordi bot from uttering these, list regexes for them in irc-config. E.g.:</p>
<pre> , censor = ["some naughty phrase", "some wicked utterance"]</pre>
<hr/><h2 id='localization'>3. Localization</h2>
<p>To get compiler diagnostics (and some (but not all) other geordi messages) in a locale of your choice, copy the following into <kbd>rt</kbd> (preserving paths, for example using <kbd>cp --parents</kbd>):</p>
<ul>
<li>/usr/lib/locale/foo_BAR.utf8/*</li>
<li>/usr/share/locale/foo/LC_MESSAGES/{cpplib,gcc,libc,libstdc++,opcodes}.mo</li>
</ul>
<p>These paths might differ somewhat on your system.</p>
<p>You may need to install a separate GCC locales package or other kind of language pack for your distro, to get the files above.</p>
<p>Furthermore, not all of the files above may be available for your locale; copy those that are.</p>
<p>Additionally, the LC_ALL environment variable must be set to foo_BAR.utf8 when geordi is started. Note that sudo clears environment variables by default, so either use</p><pre> sudo -E geordi-...</pre><p>or use</p><pre> sudo env LC_ALL=foo_BAR.utf8 geordi-...</pre>
<hr/><h2 id='problems'>4. Known problems</h2>
<ul>
<li>
Because <kbd>geordi-irc</kbd> connects as root, IRC servers that query ident may get a root response and may decide to reject the connection. (Quakenet is known to do this.)
</li>
</ul>
</body>
</html>

About

IRC C++ eval bot

Resources

Stars

4 stars

Watchers

7 watching

Forks

Releases

Packages

Contributors