jeshyr: Programming dreamsheep (Dreamwidth - Development)
[personal profile] jeshyr
Just to let folks know, the ombibus jeshyr-do-anything script at has been upgraded to cope with git.

It doesn't do quite as many things as it used to, but it does all the basics and I'll add new things back in as I figure out how to do them with git.

Jobs it currently handles include:
Apache server up/down/restart
Move between free/nonfree directory trees
Update databases
Upgrade your hack with github code
Hard reset your hack to current github state
Tidy old patching artefacts
Show apache error logs

It used to make patches and handle diffs and stuff but since that's all *so* different in git I just ripped it out and will re-add as appropriate.

You can always find the code at - I won't include it here, trying to keep it just in one place or we'll end up with 27 different versions.

Comments, brickbats, boquets, requests, and suggestions welcome :)

vlion: (matrix)
[personal profile] vlion

I have a Posterous->dw migration script. It kind of works. It worked for me taking my Posterous backup and putting it on a Dreamwidth install foxfirefey has going.

However, it is a funky stanky horrid mash of Python and Ruby. It code smells like old socks.

It does:

- give you dates

- Give you titles.

- Give you actual post.

It does not

- Do formatting.

- Do images.

- Do easy. It requires a few rubygems[1].


So. Is this going to be useful? Helpful? I can stuff it up on a github and maybe someone can take this and turn it into mo' usable code. What needs to happen - IMO- for mo' happiness is:

- Username/password not on the CLI, instead, an interactive dialog

- Ruby removed and replaced with Python such that the Python default install works.

- Formatting handled appropriately. Python Etree explodes on posterous html; HTMLParser is underpowered and will require gyrations to do this right.

Let me know what people want, if this is something wanted, I'll upload it.

[1]. If you're not a developer on Linux/OSX, this is going to be (a) gibberishy and (b) impossible to deal with in any sort of way that doesn't involve grief.
mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
[staff profile] mark
If you use the "dwu" script from the wiki, you will need to update your local copy. I've made some changes because the last version of the script would merge changes from both develop and master, leading to broken environments and GitHub repositories.

Please use the updated script.

If you have gotten yourself into a broken state, let me know and I can walk you through fixing it. There is some force pushing involved, sadly.
momijizukamori: Green icon with white text - 'I do believe in phosphorylation! I do!' with a string of DNA basepairs on the bottom (Default)
[personal profile] momijizukamori
...mostly because as anyone who gets all the bugzilla and/or style notifs knows, I did a lot of that this week *g*

First, preview images - I'd been doing them with Ubuntu's screenshot utility and photoshop, which is 1) really slow and 2) doesn't really adequately strip and compress images. So! Enter Screen Capture for Google Chrome, which I've been using with the 'full page' setting, and set to skip pop-ups and save straight to a temp image directory, where I can then rename the screenshots. After that, [personal profile] geekosaur and [personal profile] exor674 (with a little sideline ImageMagick input from [profile] tamouse_ helped me write this handy little shell script, to process all the pngs in the directory you run them on - it resizes them, crops them, strips color profiles, and indexes them.

I've been using it on my own machine, as I run Ubuntu, but I believe all the appropriate packages are now on the Dreamhack server, too, for server-side use.

Second, [personal profile] rb posted a handy little script for sorting properties for color themes and generating appropriate headers. I updated it to match our current formatting for files, add sorting for a few more properties, and output more verbose instructions on what to do next at the end.

This is written to be used server-side right now, with a command-line input like './ "Human-Readable Theme Name" user "Layout This Theme Is For" yes < inputfile' I've been running it client-side by changing line 74, 'my $filename = "$ENV{LJHOME}/temp/$layout_name-$theme_name.s2";' to 'my $filename = "temp_themes/$layout_name-$theme_name.s2";' (otherwise it tries to write to root, and That's Bad. And unnecessary)

Third, for the tiny handful of people doing S2 work on gedit (shhh, I like it, okay), I made some mods to the CSS syntax highlighting file (pastebin because the file is big). I tried to get it to make a custom S2 language, but it was being fussy about parsing it, and a lot of the .s2 files are largely CSS anyway. So this adds highlighting for S2 variables and S2 keywords! It goes in a file called CSS.lang in home/.local/usr/share/gtksourceview-2.0/language-specs, which will probably not exist if you haven't made custom languages. If you're on newer versions that use GTK3, that 2.0 should be a 3.0. You may have to manually select the highlighting, for some reason it only registers the .s2 extension some of the time.
jeshyr: Dreamwidth: Dream wide, dream deep (Dreamwidth - Dream wide Dream Deep)
[personal profile] jeshyr
Right before my brain got refried by this stupid disease I was working on a script to turn the theme layers copied from DW itself into the right format to paste into the s2 code in the sourcecode. I was doing it as I learned how so it's only been tested on about 5 different situations at the moment and I'm quite sure it doesn't do everything so check all output please!!

And yes, my brain got fried (again) by this stupid disability so I'm on indefinite leave from developing for the mean time - and VERY disappointed about it.

At the moment you want to pipe the theme layer through STDIN to the script, so something like

$ ./ NewThemeName Rising "Tabula Rasa" yes < ~/file-with-theme-layer.txt

it will tell you what file it writes the output to, it will be something in $LJHOME/temp/


Feedback, cases that break it, improvements, etc. would all be great.


Edit: Now with super bonus functioning HTML tags!
fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
[personal profile] fu
[personal profile] exor674 has added another tool to the dev tools repository, called lookup-routing

It does several things.

First, you can easily find out which file handles what page (e.g., /nav, /nav/create, /rename, /admin, /post, etc).

$ lookup-routing /admin
app: /admin is a redirect to /admin/
app: /admin/ is defined in the file cgi-bin/DW/Controller/, and using the handler sub admin_handler

This is useful if you're working on a bug that's been reported on /some/path/here, and you want to know which file to open up first.

(Psst If "lookup-routing /some/path" doesn't work, it is probably a BML file. Try htdocs/some/path.bml)

--verbose gives you a much more detailed view (plus some debugging tips) )

Second, you can get a list of everything in the routing table, using the --list argument:
$ lookup-routing --list

You can filter the list down to either those that use regex matching, or those that use string-matching:
$ lookup-routing --list --regex
$ lookup-routing --list --string

You can also filter down to just those pages in user-space, app-space, or ssl using --role=user, --role=app, --role=ssl, respectively. Default is --role=all.

There are --user, --app, --ssl shortcuts which do the same as their --role=... equivalents.

$ lookup-routing --list --user # lists paths handled by the routing system that follow the form
$ lookup-routing --list --app # lists paths handled by the routing system that follow the form
$ lookup-routing --list --ssl # lists paths routing system that use https

And third, you can get a quick summary of stats by running
lookup-routing --stats

A quick reminder of which arguments to use is available by running:
lookup-routing --help

Very detailed usage instructions can be found by running:
lookup-routing --help --verbose

If you haven't already installed the dev tools yet, see the Dev Tools wiki page. If you've installed the dev tools before, make sure to update your code, to pull in the changes.
sophie: A cartoon-like representation of a girl standing on a hill, with brown hair, blue eyes, a flowery top, and blue skirt. ☀ (Default)
[personal profile] sophie
I've just put a mass user-creation script on the wiki. It allows you to create any number of users and have them be auto-validated. It will also randomly create watch/trust edges between the created users, and if you specify it, they will all join any given community. This makes it extremely useful when you have a bug that requires a large number of users to test, such as bug 2215: member list page: "jump to account" does not jump to username, which requires more than 100 users in a single community.

(I actually already had this script created some time ago, but hadn't released it publicly. However, when I saw [personal profile] kjwcode manually creating 100 users in order to test the patch on the aforementioned bug, I added the community-joining ability and offered the script to him, and realised I should probably release it for all to use!)

There are a few things the script doesn't do yet. For example, while it can make all the users join a community, it won't make any of them subscribe to it. If anybody wants more features added, let me know!

And, in the interests of code preservation (in case the wiki ever disappears for some reason - not that it should), I'm reproducing the code as it is now inside a cut. Bear in mind that it's possible that the version on the wiki may be more up-to-date if it's been some time since this post was made, so you should probably check on the wiki first!

Source code follows! )
jeshyr: Pile of thick books labelled "Geek" (Geek)
[personal profile] jeshyr
[BTW: I am editing this post as the script is updated so refer back for further edits.]

I'm just a newbie at developing - submitted my first patch today - and one of the things one has to do to get up and running is to read about 5 tons of documentation and figure out workflows. Since I was having lots of potentially useful scripts suggested to me by developers and by the wiki and since I am at heart a toolmaker I put them all together and documented everything to the best of my ability.

I think this works but it's way past my bedtime right now and I haven't tested every single combination so if it eats your code, your data, or your firstborn child be in on your own head. OTOH I think it should work right!

For new folks, you need to copy everything in the text box above and paste it into a new file on your Dreamhack. I suggest you put it in the ~/bin directory and call the file 'dw', because then your system matches mine :). Then you need to make that file executable by typing 'chmod +755 ~/bin/dw' or whatever filename you used. After that you can type 'dw' and it should execute just fine, it'll give you instructions.

I would welcome fixes, constructive criticism, or anything else you have to offer. Feel free to use this in any way you want, etc.

pseudomonas: My rat is confused by technology (technology)
[personal profile] pseudomonas
Does LJ::Simple work reliably with Dreamwidth? If not, is there a comparable perl module that does? (I'd rather rely on someone else's testing than conduct my own, which is likely to be more slipshod)

Also (and relatedly), is there a way that given a DW entry that's been either imported from, or crossposted to, LJ, I can get (programmatically) the ID or URL of the LJ entry, without resorting to comparing timestamps and post contents?

ETA: if there's no Perl thing suitable, does anyone have any ideas for Java packages that would do the same?

(x-posted from [community profile] perl, where I got suggestions to try here)

ETA: is the current state of the script. I've tested it on a small test journal and it seems to do what it's supposed to do. If anyone's brave enough to test it on real-world data and let me have any bug reports, that'd be wonderful.


dw_dev: The word "develop" using the Swirly D logo.  (Default)
Dreamwidth Open Source Development

March 2017

5678 91011
1920212223 2425


RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 26th, 2017 05:25 am
Powered by Dreamwidth Studios