Stories
Slash Boxes
Comments

SoylentNews is people

Log In

Log In

Create Account  |  Retrieve Password


pastebin

Posted by crutchy on Sunday January 25 2015, @12:37PM (#972)
0 Comments
Code

had a go at making a simple pastebin. nothing fancy (no context highlighting, line numbers, etc)

http://paste.my.to/

similarish workings to the url shortener

url shortener

Posted by crutchy on Sunday January 25 2015, @03:08AM (#970)
2 Comments
Code

had a go at making a url shortener. very basic but seems to work

http://o.my.to/

you can also use it from soylent irc with the command "~shorten %url%" (must be identified with nickserv)

Epoch Init System 1.2.1 released.

Posted by Subsentient on Sunday January 04 2015, @06:19AM (#930)
0 Comments
Code

So I released the first update release for 1.2 series. It's a very small update, it fixes a bug that pissed me off and it adds support for something I wanted to get into 1.2.0.

The bug: There was a problem caused by dunce syndrome where the time for shutdown commands had extra or too few zeroes, caused by a tired coding problem.

The feature: Now the 'epoch status', 'epoch start', 'epoch restart', 'epoch stop', and 'epoch reload' commands can have multiple service names specified at once. That means instead of 'epoch restart aqu4bot;epoch restart aqu4bot_soy', now I can just do 'epoch restart aqu4bot aqu4bot_soy'. Saves a bit of typing if you have a big list of services you want to apply the same action to. The method I used to implement this for 'epoch status' is hideous and is ironic considering the goals of 1.2 Peroxide, but it works and it's not buggy or anything.

Those are literally the only changes in this release.
The 1.x.1 releases tend to be little bitty bugfixes and stuff.

Epoch Init System homepage
Download Epoch 1.2.1 (tar.gz)

Epoch Init System 1.2.0 released.

Posted by Subsentient on Tuesday December 23 2014, @07:24AM (#905)
1 Comment
Code

So, I've pushed out the final version of the Epoch Init System 1.2.0 "Peroxide". It's mostly a bugfix release and cleans up most of the nasty code in Epoch. Here's the tarball: http://universe2.us/epoch_1.2.0.tar.gz

I probably could have done more to it, but I wanted to just finish and get the release out so I could roll an update for my personal distro with the new version of Epoch in it. Nonetheless, this release should be pretty stable and is a recommended update. It is safe to update 1.0 and 1.1 releases to 1.2.0 without rebooting. Replace the 'epoch' binary with the new version and then run 'epoch reexec'. Check /var/log/system.log and it should tell you that you've been updated to 1.2.0. NOTE: if you do NOT run 'epoch reexec' after replacing the binary, your root filesystem will not be able to be remounted read-only on system shutdown and that could lead to data loss.
There is no good reason I can think of that you would not want to run 'epoch reexec'.

Here is a list of changes:

Changes since 1.1.1:

* Cleaned up a huge amount of code that was just fugly as hell. This is the big change.
* Removed unsigned long abuse caused by my (at the time) severe OCD.
* New service status output format. Looks cleaner.
* Extremely deprecated AlignStatusReports attribute completely removed. I doubt even one person will be affected by this.
* Add three new attributes: StartingStatusFormat, FinishedStatusFormat, and
StatusNames to manually specify an alternate service status output format.

* Specific bugfixes:
        * Don't set a config problem check to WARNING after we already found a FAILURE.
        * Fix overwriting service messages, caused by our old status format.
        * Fix inaccurate reporting of scheduled shutdown times, now report seconds too.

IRCiv development

Posted by crutchy on Monday December 22 2014, @10:49AM (#901)
2 Comments
Code

Got IRCiv back to a working state after reworking authentication to make use of new features now built into exec. Also makes use of included alias definition, init and startup directives.

New features include map image cropping (no more huge black areas), a crop_map flag, use of notice instead of pm for private status messages, queuing of messages triggered by actions of other players, use of bot IRC message handling pause/unpause for robustness against command flooding (mainly to prevent corruption of memory shared by scripts running in parallel), a game-list command, and ability to load and save all game data to files.

Join the #civ channel in soylent IRC. Must be identified with NickServ to play. Type "~civ init" to initialize your player.
Note that IRCiv is not fully playable yet and is very much a work in progress in early stages of development.

Sample test gameplay:

<civ_test_player> ~civ u
<crutchy> ~civ d
<exec> #civ crutchy => player "civ_test_player" moved a unit within your field of vision
<exec> #civ crutchy => successfully moved settler down from (66,39) to (66,40)
<exec> #civ crutchy => you moved a unit within the field of vision of player "civ_test_player"
<exec> #civ crutchy => http://irciv.us.to/?pid=3
<exec> #civ crutchy => 1/2, warrior, +100, (76,26)
<crutchy> ~civ ?
<exec> QUICK START GUIDE
<exec> unit movement: (left|l),(right|r),(up|u),(down|d)
<exec> settler actions: (build|b)
<exec> player functions: (help|?),status,init,flag/unflag,set/unset
<exec> flags: public_status,grid,coords,city_names,crop_map
<exec> http://sylnt.us/irciv
<crutchy> ~civ unflag public_status
<exec> flag "public_status" unset for player "crutchy"
<crutchy> ~civ d
-exec- #civ crutchy => successfully moved warrior down from (76,26) to (76,27)
-exec- #civ crutchy => http://irciv.us.to/?pid=3
-exec- #civ crutchy => 0/2, settler, +100, (66,40)
<crutchy> ~civ d
-exec- #civ crutchy => successfully moved settler down from (66,40) to (66,41)
-exec- #civ crutchy => you moved a unit within the field of vision of player "civ_test_player"
-exec- #civ crutchy => http://irciv.us.to/?pid=3
-exec- #civ crutchy => 1/2, warrior, +100, (76,27)

Example map:
http://irciv.us.to/?pid=2

--
http://sylnt.us/irciv
https://github.com/crutchy-/exec-irc-bot/tree/master/scripts/irciv

The Best Defense is a Good Offense

Posted by The Mighty Buzzard on Saturday December 13 2014, @03:25PM (#881)
14 Comments
/dev/random

A couple weeks ago I was having a conversation about smoking with someone and they posited this argument in favor of smoking being illegal near entrances and exits after I'd pointed out that the danger from second-hand smoke in an open-air environment was so minuscule as to not exist: The smell offends me.

That went up one side of me and down the other and today I say to everyone using being offended as an argument for anything what I said to him: I do not care.

No, that is not me being an asshole. That is me refusing to allow you to mold the world to suit you at my expense. You have no natural, societal, legal, or God given right to not be offended in this life. And neither should you.

We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness

Those, right there, are your chief three rights. It's quite important to note that you do not have a right to happiness but only to its pursuit. Also, the the end of each is precisely located where you would start infringing on the same for anyone else. Taken together with all the other rights enumerated in the Constitution, there is a further right that is very much implicit but I believe should have been explicit: The right to be an asshole. Beyond Life and Liberty, I would go as far as to say it is our most fundamental right.

You're probably thinking I am an asshole about now. Why would I say something like being an asshole is one of our most fundamental rights? It's simple, really; because anyone at any time can call anyone else an asshole for any old arbitrary reason. If this has any bearing on the rights of the person being accused of being an asshole, then they do not really have those rights and never did in the first place. All their rights are subject to sanction or removal by cultural fiat. No due process whatsoever. Only if you have the right to offend anyone, at any time, without fear of oppression are any of your other rights secure.

Large portions of our political landscape have always been made up of unscrupulous bastards who incessantly try to convince you that offending someone is bad or wrong. See this for what it is: an attempt to get you to place chains of your own making upon yourself. They know they cannot force you to behave according to their approval or disapproval, so they attempt to shame you into doing so by being offended. There is no difference today between the puritanical right and the Social Justice Warrior on the left in this; the tactic itself is as identical as it is reprehensible.

So, convince me of your position by logical or moral argument all you like. Tell me I should do or think something because it offends you though? You can jam that right up your shitter and blow some fucking bubbles with it, you fascist asshole.

wiki sections

Posted by crutchy on Sunday December 07 2014, @07:32AM (#860)
0 Comments
Code

if you're in IRC and you wanna bring up a wiki section for discussion, type:

[[title|section]]

to output the wiki page section

eg:

[[IRC|Chat bot (Python)]]

outputs:


<exec> ELIZA module that uses Futurama personalities (to match the bot's current nick) Modify bot logging to match existing formats (mIRC preferably)
<exec> http://wiki.soylentnews.org/wiki/IRC#Chat_bot_.28Python.29

bitbucket

Posted by crutchy on Saturday November 29 2014, @11:51AM (#835)
0 Comments
Code

one of the things i'm working lately is a bitbucket feed for soylent irc (similar to the #github feed)

it currently polls the events api url for one repo (uselessd) every 5 mins and spits out a message to #github if new code is pushed

i'm still trying to figure out how to relate changesets to commits listed in push events so that i can list affected files similar to the github feed. neither the atlassian api help nor google have been very helpful.

--
https://github.com/crutchy-/exec-irc-bot/blob/master/scripts/bitbucket_feed.php
http://sylnt.us/exec

14.12 Update

Posted by The Mighty Buzzard on Wednesday November 26 2014, @08:23PM (#830)
6 Comments
Soylent

The long and short of it is, there won't be one. We're pushing it until January due to me and PJ being occupied too much with holiday and Life stuff.

What you can look forward to:

  • Moderation Rework

Not a final version and we haven't touched meta-moderation yet but this will cut down on the echo chamber effect, mod bombing, and lay some groundwork for combating spam as well.

  • Input vs Output Wackiness

Currently if you put html entities in and hit preview they get transformed into literal characters. There's also wackiness if you try to put double quotes in a submission title. I hate this, you hate this, and it needed to stop so most of the code for it is already done and being tested on dev.

  • RSS/Atom Feeds Moving to SSL

There is really no reason to have http links in the rss feed rather than https links, so they're changing. I'm also doing my best to get them to encode only the necessary characters and display properly but it seems like no two readers display the same.

  • A Couple New Themes

Occasionally I get bored and do up a theme instead of actually working. This time around we have the VT100 and the OMG PWNIES themes. These are actually pretty easy to do. Feel free to mod and submit your own. All it takes is a custom stylesheet if you're okay with reusing existing favicons/logos.

  • Support for Additional Tags

We're adding standard support for sub/sup/abbr/strike tags. We're also adding support for the custom tags sarc/sarcasm and two forms of a "user" tag.

  • Additional Minor Bug Fixes

Bunch of minor bugs, some of which you would have never seen because they were on admin pages.

I think that's all but I'm not sure what the last one that went into our point release after the 14.12 update was.

exec live scripts

Posted by crutchy on Friday November 14 2014, @11:43AM (#803)
0 Comments
Code

the "~x" alias allows a bot operator to create and manage scripts from within IRC (dubbed "live scripts")

scripts created using this alias are stored in a bucket by the bot instead of a file

the handler uses php's eval to run live scripts

to prevent anyone from executing arbitrary commands on the bot host, a whois command is issued to verify that the NickServ account of the user of the ~x alias is the bot operator (by settling the userlist parameter of the alias definition line to "@")

the general form of the command is:

~x %action% [%param%] [%code%]

in a nutshell the possible actions and params are:
"global on|off" (enables or disables all live scripts)
"kill" (a shorcut for disabling all live scripts)
"enable %script-name%" (enables an individual live script)
"disable %script-name%" (disables an individual live script)
"delete-script %script-name%" (deletes a live script from memory)
"open %script-name%" (opens a live script for editing in the active channel)
"close" (closes the currently open live script in the active channel)
"code" (outputs a line-numbered code listing of the currently open live script in the active channel)
"list" (outputs a listing of available live scripts, and highlights enabled scripts)
"replace [L]%line-number% %old-code%|%new-code%" (replaces a line of code in the currently open live script)
"delete-line [L]%line-number%" (deletes a line of code in the currently open live script)
"insert [L]%line-number% %code%" (inserts a line of code in the currently open live script)
"add %code%" (adds a line of code to the currently open live script)

import and export (from/to file) actions are also proposed but not yet implemented.

live scripts have access to common lib functions used by other scripts, and also have direct access to $nick, $dest (channel), $trailing. the privmsg lib function doesn't work for live scripts as the live script handler is triggered internally by the bot using a registered privmsg event handler, so to privmsg the channel that the sender ($nick) is in you simply call pm($dest,"message) instead.

when a new live script is created, it must be enabled before it will run, but once enabled any changes will come into affect immediately.

whilst the code is currently limited to php, it could potentially be adapted to execute code in other languages using their command-line interpreters. it also doesn't have to be limited to code. it could potentially be used to collaborate on lines of non-executing text (such as for collaborative editing of SN submissions). with some tweaks it could be possible to collaborate on code as well, with other users being able to add/edit/delete lines but requiring the operator to re-enable the script for changes to come into effect.

ps: exec also now supports init: in-script directives, similar to startup: and exec: directives, which will increase self-containment of scripts further.

--
https://github.com/crutchy-/exec-irc-bot/blob/master/scripts/scripting.php
http://sylnt.us/exec
http://sylnt.us/execsrc