[Mac 101] Ask your questions here!

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,550
Reaction score
1,301
Hi guys,

I have been playing around geek tool and its really astounding how much we could customize our mac. I have been stealing codes from google but my calendar is still misaligned haha. The numbers and the day are abit misalign for the single digit.

the code is :

cal | sed -E '1,$'"s/ ($(date +%e))( |$)/ $(echo '\033[1;32m')\1$(echo '\033[0m')\2/"

anyhow knows what is the code for a aligned calendar with the current day coloured?

Thanks a lot !!

This is not pertaining to Mac OS X, that would be Unix variant related. However you will want to change your code to the following in Mac OS X

Code:
cal | sed -E '3,$'"s/[[:<:]]($(date +%e))[[:>:]]/$(echo -e '\033[1;32m')\1$(echo -e '\033[0m')/"

Anyway, this is not customising anything, just a command with manipulation.

Your RE may not work for all possible calendar dates, which I have explained below.

I have made a few changes, first the introduction of "-e" to the echo command will allow the escape codes. This is not found in the echo manual, but rather in the bash manual, depending on which shell you are using. While I have not really exhaustively figure out, it could be some shell doesn't support "echo" natively and requires an external command.

Next is I change the addresses lines matched for sed, it is good to start with line 3 instead of line 1, since line 1 and 2 are not where the dates are found. Not that your $(date +%e) will produce anything beyond 31, but it's always good to be more concise with the application of regular expressions.

I have also corrected the way you match for date numbers. You should use the word boundaries instead of detected of preceding and trailing of space or EOL, since for dates that start at the first column will not match. Word boundaries will be a better choice for the text output by "cal"

Are you a student or already working ? Anyway good try. Seldom see anyone asking about such in-depth stuffs around here :)

On Linux, you will want to use
Code:
cal | sed -E '3,$'"s/\b($(date +%e))\b/$(echo -e '\033[1;32m')\1$(echo -e '\033[0m')/"

For something more cross unices compatible, try this instead
Code:
cal | perl -pne "s/\b`date +%e`\b/\033[1;32m$&\033[0m/"
 
Last edited:

ahsiao80

Supremacy Member
Joined
Nov 19, 2010
Messages
6,754
Reaction score
45
OSX Yosemite is stable to upgrade now already right? :) And is it recommended to do a clean install as i have tons of information to transfer if i have to and it will be very time consuming.

*Note: i know this sounds weird but i don't have a HDD, only a 16GB thumb drive lol >.<
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,550
Reaction score
1,301
OSX Yosemite is stable to upgrade now already right? :) And is it recommended to do a clean install as i have tons of information to transfer if i have to and it will be very time consuming... got no back up or anything btw :/

No surgeon will tell you any surgery is risk free no matter how mature the technique and how often it has been performed, isn't it ? :) The risk is always for you to take. :)
 

szeli

Arch-Supremacy Member
Joined
Mar 24, 2003
Messages
21,482
Reaction score
3,168
OSX Yosemite is stable to upgrade now already right? :) And is it recommended to do a clean install as i have tons of information to transfer if i have to and it will be very time consuming.

*Note: i know this sounds weird but i don't have a HDD, only a 16GB thumb drive lol >.<

just make sure u backup before u upgrade. shud b fine.
 

aamaterasu

Member
Joined
Feb 1, 2009
Messages
409
Reaction score
41
This is not pertaining to Mac OS X, that would be Unix variant related. However you will want to change your code to the following in Mac OS X

Code:
cal | sed -E '3,$'"s/[[:<:]]($(date +%e))[[:>:]]/$(echo -e '\033[1;32m')\1$(echo -e '\033[0m')/"

Anyway, this is not customising anything, just a command with manipulation.

Your RE may not work for all possible calendar dates, which I have explained below.

I have made a few changes, first the introduction of "-e" to the echo command will allow the escape codes. This is not found in the echo manual, but rather in the bash manual, depending on which shell you are using. While I have not really exhaustively figure out, it could be some shell doesn't support "echo" natively and requires an external command.

Next is I change the addresses lines matched for sed, it is good to start with line 3 instead of line 1, since line 1 and 2 are not where the dates are found. Not that your $(date +%e) will produce anything beyond 31, but it's always good to be more concise with the application of regular expressions.

I have also corrected the way you match for date numbers. You should use the word boundaries instead of detected of preceding and trailing of space or EOL, since for dates that start at the first column will not match. Word boundaries will be a better choice for the text output by "cal"

Are you a student or already working ? Anyway good try. Seldom see anyone asking about such in-depth stuffs around here :)

On Linux, you will want to use
Code:
cal | sed -E '3,$'"s/\b($(date +%e))\b/$(echo -e '\033[1;32m')\1$(echo -e '\033[0m')/"

For something more cross unices compatible, try this instead
Code:
cal | perl -pne "s/\b`date +%e`\b/\033[1;32m$&\033[0m/"

The codes' output are still misalign for the the dates 1-9. This is due to the smaller width of the digits and would probably affect just the first two lines. Thereafter is all 2 digits dates and they all fall into place. I heard somewhere adding a zero infront etc (01 02 03) will help but am not very sure about the code haha.

Yea Im just a student but im just stealing codes and implementing them. Must thank those people who release their codes for us to use haha. I don't really have the flair to understand those codes...probably will take a lot of work if I want to learn how to create them hehe
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,550
Reaction score
1,301
The codes' output are still misalign for the the dates 1-9. This is due to the smaller width of the digits and would probably affect just the first two lines. Thereafter is all 2 digits dates and they all fall into place. I heard somewhere adding a zero infront etc (01 02 03) will help but am not very sure about the code haha.

Yea Im just a student but im just stealing codes and implementing them. Must thank those people who release their codes for us to use haha. I don't really have the flair to understand those codes...probably will take a lot of work if I want to learn how to create them hehe

For the codes that I have given above, I don't see any misalignment.
15zglqw.png


Have you tested them out ?

There is no zero padding require at all if you do your RE properly.

Regardless you are student or not, you are advise to study the command and understand it. Don't just use something blindly. More so that you are a student.
 

ahsiao80

Supremacy Member
Joined
Nov 19, 2010
Messages
6,754
Reaction score
45
No surgeon will tell you any surgery is risk free no matter how mature the technique and how often it has been performed, isn't it ? :) The risk is always for you to take. :)

Ye i understand that! just that i haven been tracking its progress lately but i understand when it was first release, there was a lot of issues right?

just make sure u backup before u upgrade. shud b fine.

Guess i really have to go buy a HDD liao... :s22:
 

asriznet

Senior Member
Joined
Oct 2, 2009
Messages
981
Reaction score
0
Ye i understand that! just that i haven been tracking its progress lately but i understand when it was first release, there was a lot of issues right?



Guess i really have to go buy a HDD liao... :s22:

Anything that are first release bound to have bugs. no matter how testing a tech company can do it can never be the same for every user - a million and 1 scenarios. That's why Apple release Developers preview followed by Public BETA release so that they can receive as much feedback as possible and fix bugs before the official release.

Yes, portable HDDs are cheap nowadays, 2TBs about $150 i think... Once set up with Time Machine, you don't have to do anything.

Mac Basics: Time Machine backs up your Mac - Apple Support
 

ahsiao80

Supremacy Member
Joined
Nov 19, 2010
Messages
6,754
Reaction score
45
Anything that are first release bound to have bugs. no matter how testing a tech company can do it can never be the same for every user - a million and 1 scenarios. That's why Apple release Developers preview followed by Public BETA release so that they can receive as much feedback as possible and fix bugs before the official release.

Yes, portable HDDs are cheap nowadays, 2TBs about $150 i think... Once set up with Time Machine, you don't have to do anything.

Mac Basics: Time Machine backs up your Mac - Apple Support

Alright thanks for the advice!

And could i check with you guys, is there any apps on mac store which can help me identify which files is taking up spaces in my HDD?
 

asriznet

Senior Member
Joined
Oct 2, 2009
Messages
981
Reaction score
0
Alright thanks for the advice!

And could i check with you guys, is there any apps on mac store which can help me identify which files is taking up spaces in my HDD?

There's a couple but I don't think some of them are on the Mac App Store, can be downloaded from developers website. Most likely does not meet requirement for the Mac App Store.

Omnidisksweeper from Omni Group
Disk Inventory X
Daisy Disk

I'm sure there's more but above 3 are what I've tested.

Daisy Disk is very graphical and user friendly, I think requires paid license, the other 2 are freeware though.
 

crystalnox

Supremacy Member
Joined
Feb 2, 2006
Messages
8,737
Reaction score
2,327
When claiming warranty on the 2nd and 3rd year, do they ask for any proof of having purchased apple care other than the record on your account? (MacBook)
 

asriznet

Senior Member
Joined
Oct 2, 2009
Messages
981
Reaction score
0
When claiming warranty on the 2nd and 3rd year, do they ask for any proof of having purchased apple care other than the record on your account? (MacBook)

As long as it's documented in https://selfsolve.apple.com/agreementWarrantyDynamic.do that's all you need when servicing your Mac.

Is this a 2nd hand Mac? If yes, make an agreement with the original owner so that he/she does not call Apple later on to request for cancellation of the AppleCare to get a prorated refund.
 

crystalnox

Supremacy Member
Joined
Feb 2, 2006
Messages
8,737
Reaction score
2,327

delved

Junior Member
Joined
Dec 21, 2011
Messages
26
Reaction score
0
slow Macbook (mid 2010)

Hi, hope someone can help me with this. I have a white mid 2010 Macbook unibody with the following specs:

Processor: 2.4 GHz Intel Core 2 Duo
Memory: 2 GB 1067 MHz DDR3
Graphics: NVIDIA GeForce 320M 256 MB
98GB free disk space out of 250GB

It has been occasionally laggy in the past, but nothing too unbearable. I use it for basic surfing and uni.

But I updated it to OS X Yosemite yesterday and it has been lagging more than ever, especially when I have more tabs open on firefox or when I am opening another application.

I have done the "reduce transparency" suggestion but it seems to only slightly improve things.

My questions:
1. Would changing the RAM to 8GB reduce the lag significantly?
2. I googled and it seems that most people who upgrade their RAM also upgrade to a SSD. If I have to do both would it just be more cost efficient to get a new macbook?

Thanks in advance
 

asriznet

Senior Member
Joined
Oct 2, 2009
Messages
981
Reaction score
0
Whoa you can do that? Thankfully mine's a first hand. :)

Yeah when your mac got hit with liquid or physical damage which caused the warranty to be voided, you may call Apple to cancel your APP at that point in time to request for a prorated refund, I'm not sure if they're any changes but they did honor prorated refunds few months back as checked.

Hi, hope someone can help me with this. I have a white mid 2010 Macbook unibody with the following specs:

Processor: 2.4 GHz Intel Core 2 Duo
Memory: 2 GB 1067 MHz DDR3
Graphics: NVIDIA GeForce 320M 256 MB
98GB free disk space out of 250GB

It has been occasionally laggy in the past, but nothing too unbearable. I use it for basic surfing and uni.

But I updated it to OS X Yosemite yesterday and it has been lagging more than ever, especially when I have more tabs open on firefox or when I am opening another application.

I have done the "reduce transparency" suggestion but it seems to only slightly improve things.

My questions:
1. Would changing the RAM to 8GB reduce the lag significantly?
2. I googled and it seems that most people who upgrade their RAM also upgrade to a SSD. If I have to do both would it just be more cost efficient to get a new macbook?

Thanks in advance

1. Open up Activity Monitor -> Memory and check the "Memory Pressure" at the bottom section.

If it's green then memory is not a concern but upgrading it is not too expensive anyways, you can get the maximum 8GB for about $100 i think.

2. SSDs are very cheap nowadays, you can get 256GB for less than $200
What most people are doing is dual-drive: removing your superdrive, move your HDD to the superdrive slot in a HDD caddy and install new SSD on the HDD slot. You can then fusion the drive so that it's 500GB on your main boot partition.

The performance improvement is definitely noticeable compared to your current setup which will is going to cost your around $200-300.

If you managed to sell off your current MBP and buy a new one, you're definitely going to pay a lot more than that, probably $2K more hehe..

My advice is just upgrade the ram + SSD and keep using it as long as you can since your usage is not that demanding.
 

delved

Junior Member
Joined
Dec 21, 2011
Messages
26
Reaction score
0
1. Open up Activity Monitor -> Memory and check the "Memory Pressure" at the bottom section.

If it's green then memory is not a concern but upgrading it is not too expensive anyways, you can get the maximum 8GB for about $100 i think.

2. SSDs are very cheap nowadays, you can get 256GB for less than $200
What most people are doing is dual-drive: removing your superdrive, move your HDD to the superdrive slot in a HDD caddy and install new SSD on the HDD slot. You can then fusion the drive so that it's 500GB on your main boot partition.

The performance improvement is definitely noticeable compared to your current setup which will is going to cost your around $200-300.

If you managed to sell off your current MBP and buy a new one, you're definitely going to pay a lot more than that, probably $2K more hehe..

My advice is just upgrade the ram + SSD and keep using it as long as you can since your usage is not that demanding.


Hi, thank you for your advice!

I checked the memory pressure and it is green, but memory used is 1.98GB (out of 2GB physical memory). Would this warrant an upgrade then? Haha sorry, quite a noob here.

The dual-drive idea sounds good, thanks. I found this link with the instructions (Creating your own Fusion Drive | Other World Computing Blog), but I'm not confident of doing it myself. Would you have any recommendations on where I could go to get it done and approximately how much I should pay? I am able to purchase the SSD and RAM on my end.
 

asriznet

Senior Member
Joined
Oct 2, 2009
Messages
981
Reaction score
0
Hi, thank you for your advice!

I checked the memory pressure and it is green, but memory used is 1.98GB (out of 2GB physical memory). Would this warrant an upgrade then? Haha sorry, quite a noob here.

The dual-drive idea sounds good, thanks. I found this link with the instructions (Creating your own Fusion Drive | Other World Computing Blog), but I'm not confident of doing it myself. Would you have any recommendations on where I could go to get it done and approximately how much I should pay? I am able to purchase the SSD and RAM on my end.

The Memory used is not really an accurate value to look at because it includes File Cache.

You can read more HERE

Drop me a PM, I can help you out with the upgrade.
 

Matt.Lee

Junior Member
Joined
Apr 6, 2008
Messages
86
Reaction score
0
Boot Camp

Anyone here have luck installing bootcamp on MBPR 15" mid 2014 model?
I tried Win7 and Win8 all failed to install.
 
Important Forum Advisory Note
This forum is moderated by volunteer moderators who will react only to members' feedback on posts. Moderators are not employees or representatives of HWZ Forums. Forum members and moderators are responsible for their own posts. Please refer to our Community Guidelines and Standards and Terms and Conditions for more information.
Top