Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
gary oldmans diary
Sep 26, 2005
I'd like a program that will take the earliest date string it can find from an .NZB file and change either the date modified or date created (preferably both) of the file to that date/time.
Of course, if it did this to all the NZB's of a directory, that'd be even better.
The SABnzbd thread-goers would probably love it, too.

Adbot
ADBOT LOVES YOU

gary oldmans diary
Sep 26, 2005
This is fantastic. It seems to work perfectly and I've run it over tons of files. Thank you! You don't know how useful this will be.
I'm sorry I couldn't get back to you sooner, kaniff.

gary oldmans diary
Sep 26, 2005

Jungle Bus posted:

What I need is an app for sorting IRC logfiles by channel instead of date. If I have a bunch of files with names like:
code:
20010807#fartz
20010807#buttz
20010808#fartz
and so on, I need a program to move the string of numbers at the beginning of each filename to the end, so the example given would yield:
code:
#fartz20010807
#butz20010807
#fartz20010808
Thanks in advance.
for /f "tokens=1,2 delims=#" %d in ('dir /b ????????#*') do ren %d#%e #%e%d

If you're in Windows (I'm assuming), try mine instead of Land Mime's.

gary oldmans diary
Sep 26, 2005

Tapedump posted:

If I could just keep 1) a list of a torrent's original filenames and 2) my properly renamed file names in two texts file in the same folder, and somehow easily swap back and forth between the two naming conventions I could revert my file names to match the torrent for seeding down the road when it inevitably runs out of seeders.
Hey, 486, wanna see a really long command?

gary oldmans diary
Sep 26, 2005

Tapedump posted:

Sorry, what?
Just a geeky thing for fun. I was writing a looong command (nested for's, sets, piping, substrings) to perfectly do your task, but gave up on that when I noticed this one works just just about as well:

for /f "delims=" %a in (list1.txt) do for /f "delims=" %b in (list2.txt) do ren "%a" "%b"

Out of an exponential list of renaming commands generated, only the right ones to do what you want would actually do anything.

gary oldmans diary
Sep 26, 2005

m2pt5 posted:

I'd like to see an app that can (configurably) invert mouse inputs on either axis...
The purpose for this is for games that do not offer an "invert mouse" option.
You could try SakasaMouse, but it doesn't have a keyboard shortcut of its own.
Maybe someone could make an AutoHotKey or Autoit script to change it by keyboard.
Or just keep it on the default settings and make a Windows shortcut to the program and call it when you need it, or an AutoHotkey script to run it when [WindowName] is active and close it when it's inactive.

gary oldmans diary fucked around with this message at 02:47 on Jun 16, 2009

gary oldmans diary
Sep 26, 2005

PopeOnARope posted:

I know this is LATE as all hell, but I actually use InfranView's batch rename for this.

Recently, I needed to replace a few episodes of Voyager that I'd ripped. However, with AC3 and the like being a pain in the rear end, I decided to get lazy.

So let's say, this is your file 1x0102.caretaker.xvid.ac3.dvdrip.pest.avi

First pass, I told Infranview to replace .xvid.ac3.dvdrip.pest with nothing, as well as telling it to replace . with - , and finally, to change 1x to 1. After that first pass, the entire folder is somewhat stripped, and all the season 1 files look like this:

10102 - Caretaker.avi

Now obviously, this doesn't address the later seasons. So then I just re-open it, and tell it to replace 2x with 2 and so on. Renaming done in five minutes.
If I had a bunch of shows with that exact format, I'd open Flexible Renamer and use a a regular expression.
Input I hate:
1x0102.caretaker.xvid.ac3.dvdrip.pest.avi
Output I like:
ST Voyager 1x0102 - Caretaker.avi

What I want to do is match any 1 or more characters that aren't periods, not match the next period, then match anything up to the next period followed by xvid.
Search:
([^.]+)\.(.*)\.xvid.*

I want to have the series name, space, the season and episode info I matched (that's how I usually write it), space, dash, space, the title I matched (first word capitalized), then the extension.
Replace:
ST Voyager \1 - \u\2\e

gary oldmans diary
Sep 26, 2005
I suddenly have a need for a custom app. A blacklist <-> whitelist ipv4 range converter for programs that only allow one or the other.

For instance, if fed a (alphanumerically sorted) file containing:
2.4.8.16 - 4.8.16.32
6.12.24.48 - 8.16.32.64
10.20.40.80 - 12.24.48.96


It would return a file containing:
0.0.0.0 - 2.4.8.15
4.8.16.33 - 6.12.24.47
8.16.32.65 - 10.20.40.79
12.24.48.97 - 255.255.255.255


It would definitely have to know how to deal with an octet of 0 or 255 and it would be outstanding if it can successfully go back and forth (doesn't crash trying to return IP ranges before 0.0.0.0 or after 255.255.255.255).
Doing its own sort, handling single IP's, or handling adjacent ranges (like 1.1.1.1 - 1.1.1.2 and 1.1.1.3 - 1.1.1.4) wouldn't be necessary for me, but someone else might find that useful down the road.

Edit: All IPv4 addresses being DWORDs, this is probably easier than it initially sounded to me, but I still can't do it.

gary oldmans diary fucked around with this message at 22:45 on Jun 27, 2011

gary oldmans diary
Sep 26, 2005

epswing posted:

It's about time I contributed to this thread...

First crack: http://epswing.com/shared/IPv4RangeConverter.exe


IT HAS MY NAME IN IT :swoon:

Works great, man, thanks!

gary oldmans diary
Sep 26, 2005
It seems to be hitting a snag when the first octet is 128 or over.

gary oldmans diary
Sep 26, 2005
This was a triumph!

gary oldmans diary
Sep 26, 2005

Ape Agitator posted:

I think it's got some form of overlay that sometimes is blocked and sometimes isn't.
I really can't get any problems saving that image. In Chrome, in Firefox5, in Firefox5 with NoScript. It let's me save every time.

I believe javascript right-click blocking is/can be disabled in Firefox, now. (Could've sworn I saw that option somewhere.)
When there's an image I can't save (or more likely, use Imagezoom on) and it's worth my time because I get use out of the site (Family photos sent through Facebook), here's what I do:
  1. (Firefox) Tools > DOM Inspector (CTRL-SHIFT-I)
  2. (DOM Inspector) Edit > Select Element by Click
  3. (Firefox) Click the picture
  4. (Dom Inspector) Right-click selected element > Copy Selector > Choose class (starts with #) or contextual selector (will be long) (This is probably an invisible DIV overlay. You won't get the image save option on an empty DIV. If you're selecting the IMG, stop.)
  5. (Stylish) Write new Style > for _____._____.com
  6. (Stylish New Style) Write a name for the style.
  7. (Stylish New Style) Paste the selected element to the line between the open brackets.
  8. (Stylish New Style) Add { display: none !important; } after that.
  9. (Stylish New Style) Save.
Done.

gary oldmans diary fucked around with this message at 17:27 on Jun 30, 2011

gary oldmans diary
Sep 26, 2005

Hoborg posted:

...Brother?

gary oldmans diary
Sep 26, 2005
Is making a duplicate file finder a little too large in scope for this thread?
Others exist and work, but the best one I can find gets an md5 from every single file under a directory instead of only getting the md5 of files that have matching file sizes in the first place. It takes an unnecessarily loooong time. Ironically, it has an option to ignore files with sizes below X.

gary oldmans diary
Sep 26, 2005
Windows, please. :)

gary oldmans diary
Sep 26, 2005

Hoborg posted:

Enjoy.

http://bit.ly/MPeA6V

Sorry I beat you to it, ToxicFrog.

This program gathers all files then groups them by their size in bytes, then it computes the CRC-32 of files with the same length (CRC-32 is much faster than cryptographic hashes like MD5 or SHA). Finally, for each file with the same CRC-32 it compares the raw binary contents and when it spots the first difference it aborts and marks the files as being different.

The "Save Report" button is disabled because I didn't implement that feature yet.
The description in the titlebar is hilarious! And ho-ly crap it is faster than what I was using before (or what everyone was using before for effectively finding duplicates on Windows as far as I know). As in orders of magnitude faster. I can't wait to try this on the a 2TB external tomorrow as that experience was not quite pleasant with previous tools.

Thanks man. This is really slick.

gary oldmans diary
Sep 26, 2005
Right about now I wish I knew where I could upload a Wink-created swf.

ufarn posted:

Does anyone know a good UserScript/GreaseMonkey tutorial for customizing the CSS for a site?

If not, can you write a basic boilerplate I can use for future pet hobby projects? Maybe upload it to Gist?
Firefox?
  1. Install Stylish, restart
  2. Go to the webpage with what you want to edit
  3. Open DOM Inspector (Tools > Web Developer > DOM Inspector | CTRL-SHIFT-I)
  4. (In DOM Inspector) Edit > Select Element by Click
  5. (In the page you want to edit) Click something to edit
  6. (In DOM Inspector) Right-click the highlighted item in the tree view > Copy Selector > *You might see many options here including
    1. All elements of this type (ex:"DIV")
    2. A class selector to edit a class someone wrote into the website's custom CSS meant to be applied to several elements prefixed by "." (ex:".blockedtext")
    3. An ID selector meant to be specific to that one single instance of an element per page prefixed by "#" (ex:"#forumheader")
    4. A CSS selector using complex selection rules (ex:"DIV[lang="en"][class="mw-content-ltr"][dir="ltr"]")
  7. In DOM Inspector's tree view, you may find that what you actually want to change is the parent of the element you actually clicked on, so click higher-level elements and watch the blinking red selection box DOM Inspector displays on the page. Copy the CSS selector that best fits the element or set of elements you want to change.
  8. Right-click Stylish icon on Add-on bar > Write new Style > For subdomain.domain.com
  9. (In the Stylish editor) On the empty line between the curly brackets, paste the selector you copied in DOM Inspector. You can add more selectors separated by commas if you want to apply the same rules to all of those elements (ex:".header, .footer").
  10. Following the CSS selectors you wrote/copied, add your own set of curly brackets
  11. (Within your curly brackets) Write the CSS attribute changes you want to make. If you're interested in CSS I'm sure you have some in mind, but W3 and W3Schools are pretty good. If you want to edit some CSS changes that a website has applied, DOM Inspector's style view can help you find out how those changes are written.
    Each rule should be terminated by a semicolon, but since we also want to override other CSS we're going to add "!important" to every CSS rule we write.
  12. Click "Preview"
  13. If you like your CSS changes, give it a name and save it.
  14. Right-click the Stylish icon on the page you wrote a new style for and turn your style on and off again really fast to your heart's content.

Time for an example. Let's say you don't vote threads and don't Digg threads. Might as well get rid of the distracting voting thing on your end, then. It uses the class selector "threadrate" in SA's HTML according to DOM Inspector.
In Stylish:
code:
@namespace url([url]http://www.w3.org/1999/xhtml[/url]);

@-moz-document domain("forums.somethingawful.com") {
.threadrate {
    display: none !important;}
}
You'll find yourself using "display: none !important;" a lot. So very much.

gary oldmans diary fucked around with this message at 01:32 on Oct 1, 2012

gary oldmans diary
Sep 26, 2005

thelightguy posted:

Do you have any medical basis for doing this or are you just flailing in the dark? You might do better talking to a nutritionist.
A dietician would be preferable.

gary oldmans diary
Sep 26, 2005

Buck Futter posted:

I found it here:

Unfortunately it looks like the links to download it are no longer valid.

Is there anyone that still has this and, if so, would you mind uploading it for us?
Dang and the other guy likely to have it (mastermenthe) only posted those 2 times to request it.

gary oldmans diary fucked around with this message at 00:12 on Feb 21, 2014

gary oldmans diary
Sep 26, 2005
Could someone make an app that scans a directory for files that are full of nothing but a single repeating byte and if any such files are found ask to reduce them to 0-byte files?

gary oldmans diary fucked around with this message at 21:46 on Mar 5, 2014

gary oldmans diary
Sep 26, 2005
Yes, please. Still goin' strong when I need to swap blacklists/whitelists. :)

gary oldmans diary
Sep 26, 2005
Seems to work so far. :) Thanks!

Other versions being worked on still also welcome (and code to look at is fun too).

gary oldmans diary
Sep 26, 2005
Fat32format works great and comes in a Windows GUI flavor. I've used it a bunch.

gary oldmans diary
Sep 26, 2005
I've formatted 2TB drives with FAT32Format.
Not sure why you couldn't format 16TB partitions with it at 228 64KB clusters, minus overhead.

gary oldmans diary
Sep 26, 2005

Shaocaholica posted:

Its not that its not doable its just that the windows built in tools won't let you
No, I mean a lot of sites (among which there is a lot of disagreement) say the upper limit is 2TB and Wikipedia among them, but I'm wondering if that's just due to a lack of cited verification of >2TB FAT32 partitions since the math checks out up to 16TB for me.

Someone format a 4TB drive to FAT32 (You might have to specify 16+KB clusters).

Or this is getting too off-topic...

gary oldmans diary fucked around with this message at 19:40 on Mar 26, 2014

gary oldmans diary
Sep 26, 2005

Shaocaholica posted:

I just so happen to have a 4T spare I could test against but how would you verify? Just a successful format? Test with >2T of valid data?
FAT32Format console output and Explorer reporting correct disk space should be fine.

gary oldmans diary
Sep 26, 2005

http://technet.microsoft.com/en-us/magazine/2006.07.windowsconfidential.aspx posted:

Note, however, that the maximum number of clusters is 0x0FFFFFFF—not the full 32-bit value of 0xFFFFFFFF. Since this is limited to a 28-bit value, programs that manipulate FAT32 file allocation tables can use the top four bits as tag bits in their internal data structures. Losing this capacity at the top end has no impact on the theoretical maximum FAT32 volume size. That’s because the FAT32 volume size is capped by the 0xFFFFFFFF maximum sector count, and at 512 bytes per sector, this results in a theoretical maximum FAT32 volume size of 2TB.
Does this drive have 4KB or 512B sectors? E: 4KB according to the product manual.
Although there are drives with 4KB sectors, I'm not sure programmers are as interested in taking them into account for the sake of overly large FAT32 drives as we are. It might just be that it's safer to hard-code a 2TB limit and save yourself some headaches between drive compatibility and OS compatibility. If Acronis let's you try it, I'm all for it, though.
If that's the end of this experiment for now, it was a good ride while it lasted.

gary oldmans diary fucked around with this message at 19:22 on Mar 27, 2014

gary oldmans diary
Sep 26, 2005

Shaocaholica posted:

Which Acronis tool should I be using? Free trial right?
Idunno. I'm just goin' on what evol262 said.

gary oldmans diary
Sep 26, 2005
I was browsing a youtube-heavy thread on a slower machine the other day and it sucked bigtime. I switched the SA user option for video bb-code elements from embedded videos to just links and that was obviously faster, but ruined the point of the thread anyway.
I started on this to convert the plain links to thumbnails:
code:
// ==UserScript==
// @name        SA YT Links Thumbed
// @namespace   [url]http://*.somethingawful.com[/url]
// @description Uses YT links to show thumbnails
// @include     [url]http://forums.somethingawful.com/*[/url]
// @version     0.1
// @grant       none
// ==/UserScript==

var vidList = document.getElementsByClassName('bbtag_video');

for (var i = 0; i < vidList.length; i++) {
    var p = /^.*youtube\.com\/watch\?v=([a-zA-Z0-9_-]{11}).*$/;
    var vidId = (vidList[i].innerHTML.match(p));
    if (vidId[1] == false) continue;
    var image = document.createElement('img');
    image.setAttribute('src', 'http://img.youtube.com/vi/' + vidId[1] + '/hqdefault.jpg');
    vidList[i].innerHTML = '';
    vidList[i].appendChild(image);
}
and it seems to work fine, but opening the link in a new tab is unsatisfying, too, and the image doesn't have a caption from the video title.

I can live without the thumbnail having a caption, but for some reason my attempts at removing the href of the link and instead using an onclick to have the element replace itself with something like this (let alone having it autoplay) is failing:
<iframe class="youtube-player" type="text/html" src="http://www.youtube.com/embed/X0mKpE6Z2So?fs=1&fs=1&theme=dark" allowfullscreen="" frameborder="0" height="360" width="640"></iframe>
Would someone else like to take a crack at this? I'm surprised I didn't find a ready-made solution for converting Youtube text links to thumbnails on page load and to an embedded player on click.

gary oldmans diary
Sep 26, 2005
That works great, thanks! I'll probably tinker with it just to switch around it displaying text with the thumbnail on hover.

gary oldmans diary fucked around with this message at 02:09 on Dec 19, 2014

gary oldmans diary
Sep 26, 2005
This seems like a good start: https://github.com/peterflynn/brackets-editor-nav

gary oldmans diary
Sep 26, 2005
Could someone make a cli app that accomplishes essentially nothing, but simply completes successfully after being piped exactly 1 line of (any) text? It's small, but I can't find a utility that fills this role.

Say I have a great scripted program awesome.exe running days on end doing good work that sometimes let's you know it's about to waste time and screw up some data only by sending "Warning!!!" to stdout and it's own error handling is nonexistent otherwise. I noticed string filtering programs don't necessarily wait for the program to complete and work following along while the main program works, so what I would really like to have is a program I could fit in like this:
awesome.exe | findstr.exe /i "warning!" | pokedwithastick.exe && taskkill.exe /im awesome.exe /f && echo The day is saved
I tried:
awesome.exe | for /f "delims=" %%W in ('findstr.exe /I "warning"') do taskkill.exe /im awesome.exe /f
and it's ineffective and awkward. I thought this might work:
awesome.exe | findstr.exe /I "warning" 1>&2 | taskkill.exe /im awesome.exe /f
but there's no delay and redirecting ... nothing (?) to taskkill.exe just instantly runs it because it isn't that kind of program.

Actually, I really don't even know if what I want would work either, but it's compelling.

gary oldmans diary fucked around with this message at 03:52 on Feb 12, 2015

gary oldmans diary
Sep 26, 2005

Srebrenica Surprise posted:

Any help or suggestions?
A basic windows script.

Setlocal EnableDelayedExpansion
for /f "delims=" %%D IN ('dir /b /s /ad "C:\blah"') DO (
set "BUTT= "
for /f "delims=" %%F IN ('dir /b /a-d /o-n "%%D"') DO SET "BUTT=%%F;%%BUTT%%"
echo %%BUTT%% >> C:\DirectoryThatAlreadyExists\list.txt
)



I don't have time to test this. Requesting review.

gary oldmans diary
Sep 26, 2005
Before adjusting volume with Volume Mixer, did you set the highest volume you would like for the device in Control Panel > Sound > (Device) > Properties > Levels ?

gary oldmans diary
Sep 26, 2005

nexxai posted:

Can anyone help me out?
Asking your wife to help you catalog her daily failures seems itself like an advanced iteration of a bad decision/habit started long ago. I would consider re-evaluating the problem itself, rather than acting on the current perspective of it.

I don't know the specifics of your relationship, but you see how your idea seems harsh from an outside perspective, right?

gary oldmans diary
Sep 26, 2005
How did it sort them?
Incidentally, I wish I still had the app that separated static and animated GIFs.

gary oldmans diary
Sep 26, 2005
It's a crime when such a status app is only usable in full window mode instead of making use of the system tray.

mobby_6kl posted:

Oops, forgot about this, sorry :D

Yes this was me, you can get the GIF thing here: http://mobby6kl.nfshost.com/apps/gif.rar

Just run the exe with two arguments for folders where the static and animated gifs would be moved, and it will go through the gifs in its directory. I don't recall how exactly I came up with that identification method but it's not perfect and there are a few incorrect classifications, but shouldn't be too many.
Thanks, man! This is the thread that keeps on giving -again! Giving-er.

gary oldmans diary fucked around with this message at 05:09 on Aug 25, 2016

gary oldmans diary
Sep 26, 2005
Should it be listening for a sound file on your hard drive being played by another program? If so, you could see if the last access timestamp changes when it plays.

gary oldmans diary
Sep 26, 2005
It would probably be easier to use Cheat Engine to detect the event that triggers the sound to play than to identify a sound from the audio. Then, have it execute whatever command you like.

gary oldmans diary fucked around with this message at 20:06 on Sep 24, 2016

Adbot
ADBOT LOVES YOU

gary oldmans diary
Sep 26, 2005
Yeah, even if you made something like a passive trainer to accomplish this, using Cheat Engine to make that tool would be risking a VAC ban.

...Maybe if you had a spare (or virtual) PC and Overwatch has an offline mode with bots, you could install it on that PC, install Cheat Engine on that PC, physically disconnect that PC from the network, make the tool, and uninstall Steam before reconnecting that PC to the network. Then Steam couldn't very well have an opportunity to VAC ban you at all.

  • Locked thread