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.
 
  • Post
  • Reply
Lawen
Aug 7, 2000

lol internet. posted:

Looking to mass rename a ton of files within a folder in OSX.

They're all named with random numbers.

Example:
3422 - Filename1.ext
9483 - Filename2.ext
8472 - Filename3.ext

I'd essentially like to remove the first six characters so they look like this:
Filename1.ext
Filename2.ext
Filename3.ext

I tried poking around with automator but failed. Pretty sure this can be done in terminal but my scripting skill suck. Can anyone help me out?

This isn't very elegant but it should work:
code:
for f in *.ext; do newname=$(echo "$f" | sed 's/^[0-9 ]*\ \-\ //'); mv "$f" "$newname"; done
Just cd to the relevant directory and change the *.ext at the beginning to the correct file extension before you run it.

Adbot
ADBOT LOVES YOU

Lawen
Aug 7, 2000

lol internet. posted:

edit: if you don't mind me asking how long have you been doing scripting? I assume you work in IT?

I've been doing unix admin stuff for 12+ years and spend most of my day in a terminal. Most of that one-liner was just a little bash shell "for" loop, the sed stuff in the middle is the tricky bit but once you figure out regular expressions it's not as intimidating. That book that Sonic Dude linked looks good, I also really like the O'Reilly "Learning the BASH Shell" book (and the "BASH Cookbook" for reference). Once you feel comfortable navigating around the shell, start reading up on doing BASH for and while loops and if/else/elif conditionals. Then grep (or ack), and sed/awk/regular expressions. Once you have a handle on those, you can do all sorts of crazy poo poo from the command line.

If you use GeekTool, a bunch of the geeklets are just shell scripts; you can tear them apart to see how they work and steal snippets from them. Might be a good way to get your feet wet.

Lawen
Aug 7, 2000


I got Divvy in some Mac App Bundle a year or two ago and have been using it ever since, it's pretty great if you want a GUI way of doing most of the stuff that Slate does without having to mess with rc and config files. It's $15 though on the App Store unless you can catch it on sale.

I hadn't heard of Slate, it looks pretty rad. Too bad there's not a homebrew keg for it. Going to download it and play around some to see if I like it better than Divvy.

Lawen
Aug 7, 2000

I'm a big fan of Remember the Milk for task management and run it in a Fluid.app instance on OS X for a pseudo-dedicated app. They have apps for iOS, Android, and Blackberry that are much cleaner on mobile devices than the web app but you have to upgrade to Pro ($50/year I think) to get full push notifications and insta-synching. I've been Pro for a year or two and think it's totally worth it. There's also a ruby gem (rumember) that lets you interface with RtM via the terminal, and you can use that as an Alfred extension to create new tasks via Alfred.

Lawen
Aug 7, 2000

LASER BEAM DREAM posted:

I'm pretty new to graphic design. When the new version inevitably comes out will I have to pay full price, or do they offer an upgrade discount?

I think the Student version isn't upgrade eligible. I may be wrong, but I think the retail on the upgrade version is either $199 or $299 so the student version is still cheaper. But if you finish school and can't get student pricing anymore, I think you'd have to buy the full version once before you could start buying the upgrade versions.

Lawen
Aug 7, 2000

Crossposting from the Chrome thread 'cause I'm stumped and not getting any suggestions over there:

CMD+` has stopped cycling through Chrome windows on one of my Macs. It still cycles through windows in other apps (e.g. Safari) on that Mac. It works fine in Chrome on my other Macs. Chrome extensions etc. are synced across all of my computers and I haven't installed any new extensions recently. Running newest Chrome version. Anyone seen this behavior before and know what might be causing it?

Lawen
Aug 7, 2000

Is there a way to leave Prefs -> Mission Control -> "Displays have separate Spaces" enabled, but to assign different spaces to the internal and external displays?

Right now, with that option enabled, I can switch my MBP's internal display between Spaces 1-3 but my external display is effectively stuck on Space 4. Is there any way to, e.g. assign Spaces 1-3 to the internal display and assign Spaces 4-6 to the external display? I'd love to be able to mix and match spaces on the two different displays. Help?

Also, here's a tip for anyone who can't find the CLI Tools add-on in XCode5's Prefs -> Components under Mavericks and needs it installed/updated for homebrew or whatever: Go into a terminal and run "xcode-select --install", it should prompt you to install the CLI Tools.

Lawen
Aug 7, 2000

angor posted:

Woah, ok I'm a little confused (and way out of my depth).

I ran this:

code:
[@dev1 sandbox]$ find . -type f -not -name ".*"
./index.html

but without the ./index.html. It gives me a list of all the files (excluding hidden stuff) which is a total of 14. Easy enough to count, but I want to run this on a folder that has over 1000 files, so manually counting is out. How do I get a number from this? After running find . -type f -not -name ".*" if I run ./index.html it says "-bash: ./index.html: No such file or directory". I'm sure I'm doing something wrong.

You need the |wc -l on the end to return a count

Edit: I didn't know about the -not operator in find, so thanks for that Pivo. I would've done it with regex "[^\.]*" instead but I think your way is cleaner.

Lawen fucked around with this message at 18:28 on May 12, 2014

Lawen
Aug 7, 2000

Ashex posted:

I keep running into a weird issue with iTerm. When I'm connected to my archlinux box and am doing an update with pacman via sudo the terminal sends ^M when I hit return. This doesn't happen in Terminal, anyone know why this happens?

Weird that it only happens in iTerm, not Terminal.app. Does it only happen when you're su'ed to root and doesn't happen when you're logged in as a normal user?

2 things maybe worth trying:
1) su to root and run "set -o vi"; it may be set to emacs mode?
2) in iTerm prefs; check your profile under the "Terminal" tab and make sure your "Character Encoding" is set to "Unicode (UTF-8)" and change the "Report Terminal Type" to "xterm" or "xterm-256color"

Lawen
Aug 7, 2000

Pivo posted:

I have a Debian machine and I share the mouse and keyboard with a Mac Mini using Synergy.

I want to lock the Mac Mini when I lock the Debian box, and unlock the Mac Mini when I unlock the Debian box. I'm guessing I'll need some client software running as root on the Mini, and figure out how to run a script on lock/unlock on Debian (gdm3). Anyone have any ideas? I don't want to waste too much time on this.

Locking isn't too hard, you can just have your Debian box fire off a script that SSHes to the mini and runs "/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"

I'm not sure about unlocking though and don't have a second computer handy to test with. The only flag other than -suspend that I could find for CGSession is -switchToUserID <value> but I'm not sure if you can just feed it the current user's ID to force an unlock.

Lawen
Aug 7, 2000

dik-dik posted:

Does anyone here know why Finder is so profoundly terrible when it comes to navigating network drives or copying files to/from them? What's a better option for moving large numbers of files from one mac to another?

What do you mean by terrible? Slow? Transfers fail? What file system are the external drives (OSX formatted HFS+, NTFS, or something else)? Are they connected via USB or Ethernet?

I have an NTFS NAS connected via GigE and an HFS+ USB3 drive and don't ever really have any problems with either.

Lawen
Aug 7, 2000

dik-dik posted:

I'm transferring from my old MacBook Pro to my new MacBook Air, over wifi. Even just browsing the other computer's files can cause Finder to really slow down and hang sometimes, and then the transfers themselves seem to be going way slower than they should be.

Huh, haven't really seen that issue. Maybe you're just saturating your wifi connection? If you have the dongles and a hub/switch/router handy, you may want to try wiring them up.

Another option would be to try the transfer via the terminal with either scp or rsync.

Lawen
Aug 7, 2000

I've decided to give full-screen apps another shot but have a couple questions:
1) Is it possible to bind a keyboard shortcut to directly switch to the full-screen app's desktop/space? I use CTRL+1,2,3 to switch between my spaces, is there a way to bind CTRL+4 to the full-screen app's space? I know I can use CTRL+Left/Right arrow but I want to be able to jump straight to the full-screen space with one keypress.
2) Is there a way to run another window of the full-screened app in non-full screen mode on another space? Alternately, is there an easy way to run 2 distinct instances of the same app? I want iTerm2 running full-screen in a space but I also want a small iTerm window on Space 1 next to my browser for running quick commands. Currently, if I CMD+N a new terminal window while I'm in full-screen, it spawns a new space with a new full-screen instance of iterm.

I think these were the same issues that bugged me about full-screen mode when it was first introduced but if there's a way to work around them, I should probably figure it out.

Lawen
Aug 7, 2000

ambushsabre posted:

I use iterm exactly like this, and it's never given me any trouble. Fullscreen one, do CMD+N and it'll automatically switch over to the new instance, then just do CMD+enter and it'll turn just that one back into a window.

That worked, thanks. I'd just assumed that if I took any window out of fullscreen, it would take them all out.

It still seems a bit weird with CMD+TAB and CMD+` behavior though; CMD+TAB seems to focus whichever iTerm I was last in unless there's an iTerm in the current space, in which case it always focuses that one. CMD+` won't cycle between windows on different spaces (which I guess is always true and I'd just never noticed). I can probably get used to it but it's a little annoying. I think a way to bind "Switch to Fullscreen Space" to a keyboard shortcut would make my workflow about perfect.

Lawen
Aug 7, 2000

japtor posted:

Probably overkill for what you want particularly cause it's $15, but Witch might work for you.

Nice, thanks! Playing around with the demo and it looks like it'll mostly do what I want.

Lawen
Aug 7, 2000

I don't know what most of that jibber jabber was about but for #1 Viscosity is a $9 OpenVPN app with a decent UI.

Lawen
Aug 7, 2000

Since I have to dig it up every time chrome updates, here's the current method to disable its stupid notifications and Google Now bullshit (note, Google tends to move these settings around between Chrome versions and re-enable them every time you update -- this should be accurate for v.35.0.1916.153)
- Go to chrome://flags#enable-google-now and set it to "Disabled"
- Go to chrome://flags#notification-center-tray-behavior and set it to "Never Show"

Lawen
Aug 7, 2000

Vaporware posted:

I don't even know what kind of application to search for. I'm having trouble moving files with finder. Sometimes I get a random error then I have no idea what transferred and what needs to start over. And OSX is retarded about restarting the copy (REPLACE or CANCEL, great guys).

I need to be able to reliably copy 50 gigs of data without nursemaiding Finder, I'm moving VHDs all the time. Typically I'm moving them onto a SMB share or to an USB3/Thunderbolt external drive. Formatted exFAT, HFS would be better, but windows.

Do I need a finder replacement, or a SMB client, or a just a dummy's GUI for the robocopy equivalent command on OSX?

How comfortable are you in a terminal? rsync should do what you want.

Lawen
Aug 7, 2000

Toe Rag posted:

What exactly is supposed to be so awful about Finder? I've never understood it. I use Windows and OS X almost everyday, and I never find myself missing Explorer.

I also hated the Finder when I switched from Windows to OSX. I spent a few years using PathFinder, then switched to TotalFinder for the past few years. I consider TotalFinder a must-have for the following features:
• put folders at the top of the directory structure (Windows does this, Finder does not)
• tabs and split panes (Explorer still doesn't do this AFAIK)
• hot key to slide Finder in from the bottom/top of the screen visor-style, regardless of which Space you're on (another thing Explorer can't do AFAIK - do new Windows versions even have built-in virtual desktops yet?)
• toggle to show hidden/system files (Windows does this with a check box toggle in its Options but TotalFinder lets you assign a keyboard shortcut to hide/show, which is nice)
• automatically adjust column widths (Windows doesn't do this AFAIK)

So yeah, most of the features I can't live without aren't features that are available in Explorer anyway.

I also spend a lot of time on the command line and find it's often easier to use some regex-using series of piped commands to handle complex file manipulation than trying to do it in Finder. Having a real Unix shell (zsh in my case) is so much better than trying to get stuff done in Windows CLI with PowerShell or even CygWin.

I guess my suggestion to people who can't stand Finder is to buy TotalFinder and/or buy some kind of Learning Linux/BASH book.

Lawen
Aug 7, 2000

Kingnothing posted:

Almost all of those are strictly preference, with the exception of hidden files which should be rarely needed in OS X. Mavericks has added tabbed windows.

Well yeah, I was talking about why I preferred TotalFinder. Which seemed germane to a discussion about why people prefer Explorer to Finder. :confused:

Also, probably the biggest pain point for moving from Explorer to Finder is that you can't expand the folder structure in-line in the sidebar of Finder like you can in Explorer. To copy a file to a subfolder that isn't in the sidebar you either have to fiddle with putting 2 Finder windows on screen so you can drag from one to the other or do an awkward drag and hover to navigate the file system (and lose your original place in the filesystem). TotalFinder's split pane view is much more tolerable.

Lawen
Aug 7, 2000

Just checked and looks like it'll only log to .txt file and it's either all on or all off, no way to only log on specific channels/queries/networks. But it's just a bunch of text files, so you can log everything and it won't use much disk space.

Lawen
Aug 7, 2000

Tippis posted:

…especially when it doesn't actually work and just causes itunes to say “so, I see you have no library — let me wipe it out for you so you can add everything back in again” (never mind the contradiction in wiping something out that it apparently can't find). And when I say “say”, I mean “just do it without telling the user”. In fact, a lot of it is just down to iTunes not asking the user anything and just happily nuking itself if it can't find its library.

It's been a while since I moved my iTunes library to my NAS but I don't remember having any of those problems. IIRC all you should have to do is go into iTunes prefs, change your "Library Location" to point to the new volume and directory, then run the Organize (or Consolidate maybe?) My Library command and wait for it to complete.

In fact, iTunes is bad about coping with an unmounted NFS volume causing it to fall back to the default Library location if my NAS isn't mounted when iTunes starts. It'll start fragmenting my library, putting new stuff on local disk while everything else stays in its original location on the NAS. Running through the above steps works fine to get everything back on the NAS.

Lawen
Aug 7, 2000

Has anyone tried running the beta in a (Fusion6) VM? I wouldn't mind playing around with it so I can start updating my mackup configs and Boxen manifests for Yosemite but Fusion can be kinda bitchy about new OSX versions. If it's impossible or a huge pain in the rear end I'll just wait.

Lawen
Aug 7, 2000

EL BROMANCE posted:

Has anyone had a weird bug that seems to exist between Safari and Adium recently? Tends to occur any time I click something in Safari that isn't a strict link (like a javascript box or something). Instead of doing what I want, it does nothing and Adium becomes the highlighted app. If Adium is closed, it doesn't happen.

Thought it might disappear when I did the Yosemite beta install, but it's still occurring then too, but not on my MBA, just my iMac. It's odd.

Sounds like something's jacked up with your URL handler, making it think Adium is the default application for those types of links. Google "OSX URL handler" or take a look at this.

Lawen
Aug 7, 2000

B4Ctom1 posted:

We can sit here and talk about the who's and why of why they should do one thing and not another, but it isn't going to get them to change their mind on the pages I need to use that require IE Compatibility mode.

No one really cares about the details of why your company is stuck with a legacy web service. What was being asked was whether this was a "secure" system -- do you have to be on a VPN or something to access it? Or can any public computer (with IE running in compatibility mode) access the site as long as you have a valid username and password? If the former, you're going to need to run a local VM on your MBA (assuming your company has a security policy and you don't want to violate it). If the later, you can just RDP to a hosted VM or whatever and won't need to run a local VM.

Lawen fucked around with this message at 02:52 on Aug 4, 2014

Lawen
Aug 7, 2000

Tippis posted:

I used that kind of setup before, but it tended to lead to the opposite problem: the mac would for whatever reason desperately cling to the last shreds of ac signal rather than switch over to n so I'd get more connection errors. That was the reason I switched to a single SSID: at least then it stages down properly. Just like now (but in the opposite direction) the signal was apparently juuust good enough not to trigger a switch-over even though it would be beneficial to do so.

Ah well, a quick on-off sequence is still better than having to manually switch networks just because OSX is stubborn and clingy. :haw:

You could probably write a tiny shell script that just does "ifconfig en1 down && ifconfig en1 up" and make that a shortcut in your dock (or alfred or launchbar or whatever) and use that to up/down wifi with a single click.

Lawen
Aug 7, 2000

Pivo posted:

I've just realized that I've been living a lie. I've had my OS X install so long that throughout all the upgrades my Terminal font was still Monaco. I switched to Menlo and I feel like I have no idea what I've been doing with my life. "What do you mean it doesn't look like crap when it's not tiny?!"

Meslo is even better since the line spacing is a little more generous. Meslo DZ is even better-er 'cause dotted zeros are :cool:

I'm sure there's a non powerline pre-patched version on GitHub but I had the patched version starred and powerline is awesome too.

Lawen
Aug 7, 2000

That HTTP Switchboard extension is loving awesome. It looks like it completely replaced ABP, AdBlock, and Disconnect for me. It also uses Pollack's Host File as one of its blacklist sources which is amazing. I've been trying to maintain a git repo for my host file and merging in his changes and checking it back out on all my machines. This makes it so much easier to maintain and lets me unblock per ad/element.

I'm always kinda shocked when I use someone else's browser at how many ads are on pages I go to every day.

Lawen
Aug 7, 2000

Eight Is Legend posted:

Does anyone have experience with this app? http://macpaw.com/cleanmymac

I got it in a MacHeist bundle or something a year or two ago. It's pretty good for cleaning up caches, logs, and unneeded language files, as well as uninstalling apps and finding large files to remove. The UI is really nice too.

I don't know that I'd pay $40 for it though. Between the $13 AppZapper and free Disk Inventory X, you can duplicate a lot of the functionality pretty cheaply. If $40 isn't a big deal to you or you're desperate to reclaim as much space as possible, it's probably worth it.

Lawen
Aug 7, 2000

ChocNitty posted:

I downloaded a program called handyPrint so I could print documents from my iPad to my non AirPrint supported printer thats connected to my iMac (it didn't work)

But I just need to remove it. It's in my system tray (whatever it's called on OSX), but when I click on it, there's no option to close it. And I don't see the program in my Applications folder.

When I search for handyPrint in finder, it doesn't find anything.

I'll google that for you while I take a poo poo...

System Preferences -> right click Handy Print -> Uninstall "Handy Print" Pref Pane

http://www.netputing.com/applications/handyprint-v5/

Lawen
Aug 7, 2000

Does anyone know how to enable sysstat in OSX? It's installed, /var/log/sa exists but is empty, /usr/bin/sar is in my path but running it returns:
sar: failed to open input file [-1][/var/log/sa/sa25]
...which makes sense, since it doesn't exist.

Guessing I need to enable it so it'll start logging but "locate sysstat" doesn't return anything, so I'm not sure where to enable it.

Edit: Nevermind, found the man pages for sadc, sa1, and sa2 which I think answered my question. Seems like a weird implementation but whatever.

Lawen fucked around with this message at 02:42 on Aug 26, 2014

Lawen
Aug 7, 2000

coaxmetal posted:

I'm trying to get Sheepshaver working, and I need a copy of Mac OS between 7.5.4 and 9.0.4. 8.6 Would be ideal. Regardless though, that poo poo is impossible to find, legally or not. Anyone have any idea where I could get a classic Mac OS image? or even physical CD, if it isn't like $60

Google found this, 7.5.3 and updates to 7.5.5 for free and have a list of places (but no links, weirdly) you can supposedly buy copies of other old Mac OSes. No idea if the downloads work or if the list is wildly out of date though. Good luck.

Lawen
Aug 7, 2000

Axiem posted:

At the moment, my wife and I use Bittorrent Sync to keep our photo libraries in sync between our computers. We therefore still do our photo management by filesystem, instead of using something like iPhoto to manage them.

My wife, who is used to Windows, is rather unhappy with OS X, though. For some reason, the create/modify dates on the photos does not actually correlate with the actual EXIF data of when the photo was taken. In Windows, she would be able to see the EXIF data in Windows Explorer; in OS X, though, she cannot, and she complains very vocally to me about this omission.

Given that we share photo libraries (and various other reasons), moving to something like iPhoto is a no-go for now. (It would be really nice if iPhoto was a lot kinder to having a library shared between several people).

I suppose somehow changing file metadata to match the EXIF would work, but what would be really nice is either a way of adding a "Date Taken" column to Finder, or to find a filesystem management application that can do EXIF data in its column display.

Does someone have a good idea on how to rectify this situation?

I haven't tested it but you should be able to scrape the date from the exif and set the file's timestamp to it this way:
Download this program
In terminal, run: chmod a+x ~/Downloads/jhead
cd to the directory all of the photos are in
Run: ~/Downloads/jhead -ft *.jpg && ~/Downloads/jhead -ft *.JPG

You could easily wrap that in a bash script or even make an applescript droplet out of it. Just keep in mind you'll need to run it anytime a photo is edited or new photos are imported.

Lawen
Aug 7, 2000

Is it just me or is the newest Textual 5 update a loving train wreck for anyone else? I had 5 installed and working fine, updated yesterday and am getting all kinds of weird behavior like CMD+TAB'ing working when I'm switching from Textual to another app but not working when I tab from another app to Textual. Also, my mouse clicks won't select channels, I have to CMD+[ or ] to cycle through channels.

If it's just me, I'll try uninstalling/reinstalling but if other people are having the same issues I'll just wait for another update.

Lawen
Aug 7, 2000

iostream.h posted:

What's the best solution for automatically updating the metadata on video files? I've been converting a bunch of my old DVDs and while iFlicks 2 is usually pretty good about finding the information online, it's not very reliable.

I use Subler and don't have any major complaints.

Lawen
Aug 7, 2000

Aww. I missed the Alfred.app talk :(

Anyone tried Alfred Remote yet? I can't quite wrap my head around it. Isn't the point of Alfred to minimize the need to take your hands off of the keyboard? I've been trying to think of clever uses for it but I'm not coming up with much. I guess it'd be nice to lock my laptop from my phone if I get pulled away but that's not enough to justify $5.

Lawen
Aug 7, 2000

jackpot posted:

So are there any apps that make Finder not a piece of poo poo?

TotalFinder. Any time I have to use someone else's Mac I get angry if they don't have both TotalFinder and Alfred installed.

Lawen
Aug 7, 2000

kapalama posted:

Is there a Jdownloader replacement for YouTube video downloading, since JDownloader seems to given up being able to download YouTube stuff?

I don't know what JDownloader is but youtube-dl is in homebrew and is good at downloading YouTube stuff. If you're looking for a browser extension or gui app though, I've got nothing.

Lawen
Aug 7, 2000

GokieKS posted:

Yeah, I know they haven't updated it and won't, but it had been working fine until some point recently. It's not like rsync is a bleeding-edge program so it didn't matter that it was out of date so long as it was still forward compatible with the versions included by default on other *nix OSes, but that no longer being the case is annoying. MacPorts/Homebrew is easy enough that anyone who really needs rsync is probably more than capable of updating it that way, but it's just another chink in the "it just works" reputation when it comes to OS X.

I dunno man, as someone who does DevOps poo poo all day everyday on OSX: if you want to admin *nix boxes or do any dev work other than writing iOS/OSX-exclusive apps, you pretty much have to just suck it up and get comfortable with using homebrew (gently caress fink and macports, that poo poo's old and busted) to keep modern versions of command line tools installed and updated.

Adbot
ADBOT LOVES YOU

Lawen
Aug 7, 2000

DigitalRaven posted:

For those who keep forgetting to sudo:

alias gently caress='sudo $(fc -ln -1)'

You can actually do the same thing without an alias using the "!!" built in to repeat the previous command:

$ rm -r ./*
Insufficient Permission
$ sudo !!
sudo rm -r ./*
Password:

(Phone posting but you get the idea)

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply