General :: How To Automatically Change Zshrc For Different OS
Feb 9, 2011
I am currently storing most of my dotfiles in a git repository to make keeping them in sync across all my computers easier. I've just recently acquired a Macbook so now have to have all my dotfiles supporting the differences between Linux and Darwin. The first incompatability that I have encountered is colour coding ls, in Linux this is the flag --color=auto and for Darwin it is -G.
My first attempt at making my .zshrc portable is to do the following:
case `uname` in
Darwin)
alias ls='ls -FG'
;;
Linux)
alias ls='ls -F --color=auto'
;;
esac
Once I find a few more things to change I'll probably pull the computer specific stuff out to separate files to keep it a bit cleaner. What I'm mainly wondering is if there is a better way to do this other than using `uname` to determine which stuff to run.
View 1 Replies
ADVERTISEMENT
Jun 16, 2011
I've created a set of users using the newusers command. Unfortunatelly ive messed up and added all users to the 1000 group as primary group instead of giving the group argument as null what would add them to a new group. To make things clear:
The entries should be
user:password:::User Name:/home/user:/bin/bash
but I did
user:password::1000:User Name:/home/user:/bin/bash
I need to create the missing groups. A simple fix could be do a for loop creating a group with the name of each user in my file and then adding the users to it. Are there any dangers of doing it? What impact could this change have? Are there any safer ways?
A combination of the following commands:
Quote:
Add users to a group with the gpasswd command:
# gpasswd -a [user] [group]
To delete existing groups:
# groupdel [group]
To remove users from a group:
# gpasswd -d [user] [group]
If the user is currently logged in, he/she must log out and in again for the change to have effect.
Quote:
for i in (names)
do groupadd $i
gpasswd -a $i $i
Assuming I've created all users in group 1000 I could remove them from it with
Quote:
# gpasswd -d [user] [group]
View 2 Replies
View Related
Jun 21, 2010
i am using squid proxy on centos 5.x release with stable version. during installation time i fixed date time region.it was basicaly gmt +3:00 hours. so everything was fixed, now since past few days every 24 hours it change its time automaatically. this looks like it take update somewhere from internet or internally something is mess up.could someone guide me how to fixed permanantly date time. even either restart the machine or passing 24 hours it do never change it. etc
View 2 Replies
View Related
Mar 30, 2010
I installed the webilder application to automatically change the wallpaper, preferences you've specified the directory where the images but I can not change the background. Does anyone know why not change?
View 5 Replies
View Related
Jan 25, 2010
what to do for lock automatically slackware 13 if not used for n minutes ?What can i do to start automatically the ktorrent (a bittorrent program for linux) on system starts on slackware 13 ?
View 2 Replies
View Related
Mar 14, 2010
I'm wondering if anyone is aware of a way to cycle through workspaces at a set interval.. whether it be a screen saver or other wise
View 3 Replies
View Related
Dec 15, 2010
So I have Windows 7 and Ubuntu dual booted on my computer, and the default is Ubuntu. I was wondering if it was possible to make it such that the default is the last booted system? As in, if I was in Windows, and restarted, then GRUB would highlight Windows.The mainmotivation is to for when the computer restarts automatically (say after an update). I may not be around during the 10 seconds before it boots into Ubuntu.
View 1 Replies
View Related
Apr 25, 2010
I have my 10.04 set up with english (us and gb) as well as spanish languages installed.
I have firefox 3.6.3 compiled and installed for a 64 bit system. The firefox source code comes only with en-US locale, so I obtained en-GB.jar and es-ES.jar (as well as their manifests) from firefox.com and added them manually to my chrome directory.
This had worked in the past, when I'd logout and switch the gnome locale to es-ES firefox would come up in es-ES etc, but for some reason firefox will only start up in en-US now.
How can I fix this to match the desired behaviour?
View 2 Replies
View Related
Apr 6, 2011
In order to effectively change the computer name of an Ubuntu system, I've been told I need to edit /etc/hosts and /etc/hostname.I can set up a script that I have on the administrator desktop, and just double click it and put in the computer name I want to change it to, and it save hosts + hostname and then reboot the system?
View 3 Replies
View Related
Dec 9, 2010
I searched the forums for a long time and could not found any relevant informationI am new to ubuntu (10.10 64bit) and I just want to know if it is possible, like it is in win7 (sorry!), if I can plug in my hdmi cord and have the laptop speakers and display disable, and have the external display and its spears enabled.
View 2 Replies
View Related
Jan 2, 2011
I'd like to tweak my Conky so it automatically displays the days of the week correctly. So for example, if TODAY were Tuesday, it would look like this:
Tuesday
Wednesday
Thursday
Friday
[etc.]
And then tomorrow, *automatically*, it would look like this:
Wednesday
Thursday
Friday
[etc.]
I know I can get it to display *today's* date like this:
${time %A}
But how do I get it to display tomorrow's date?
View 1 Replies
View Related
Apr 22, 2011
when i was sleeping my computer restarted itself and when i signed back in all the windows were huge. the resolution is set at 900x600 and no other option makes the windows smaller.
View 1 Replies
View Related
Jan 31, 2011
I have a problem with Maverick. Whenever I change my volume or brightness from the keyboard, as soon as the indicator goes down, my mouse automatically switches to drag mode. I have to switch to open terminal by keyboard shortcuts and reboot
View 2 Replies
View Related
Jul 4, 2010
my problem is on installing nvidia driver on fc12 32bit but, first of all, as i understood the pae kernel requires more than 4gb of ram,i have a 2.2 ghz cpu with 2 gb ram,but when i run command:uname -r it answers: 2.6.31.5-127.PAE [i have fc12 32 bit] when we try to download linux we have a 32bit edition or 64bit edition,do we have an edition which is only for pae? or when we install for example the 32bit edition on a computer with more than 4gb of ram then the kernel automatically will change to be a pae kernel??
View 10 Replies
View Related
Feb 28, 2011
I am having trouble getting grub to automatically boot into ubuntu server. When I turn on my server the grub menu shows up and shows me the choices. They all work fine except that grub wont automatically select one. This wouldn't be too much of a problem but this is a headless server and I can't boot into ubuntu without a keyboard. I tried looking through the grub 2 documentation but nothing seemed to work when I edited the conf file.
View 1 Replies
View Related
May 7, 2010
I have upgraded to 10.4 and and after try to install mac look in ubuntu.My screen start flickering, I found it this due to in system => preference => appearance => effect become no effect automatically (as each and every time I select extra effect)After some time.for changing this setting i need to turn off the computer and restart then after i can do it i.e. change effect to extra effect. Its done after following installation
[URL]
View 4 Replies
View Related
Aug 5, 2009
What config file do you change to change default run level???
View 3 Replies
View Related
Nov 4, 2010
how do I uninstall Java? Tried with Synaptic and apt-get remove, but uninstalling sun-java6 automatically adds default-jre (openjdk) and uninstalling openJdk automatically installs sun-java ... but I don't want ANY Java on my machine - am I missing something? Already thought I maybe have a package that requires SOME kind of Java, but how do I find out?
View 2 Replies
View Related
Jan 5, 2010
I want to mount a partition automatically when ubuntu starts.I have read some articles about but i think i make some mistake.I have read about etc/fstab and I wrote a statement below./dev/sda5/home/xyz/Desktop/ABC udf,iso9660 user,auto,exec,utf8.
View 4 Replies
View Related
Jul 16, 2010
Is there a way to make apt-get install answer "yes" to the "Do you want to continue [y/N]?"?
View 5 Replies
View Related
Mar 21, 2011
I am using Vetor Linux and I want to login automatically every system starpup instead ask for user and password. Vector linux is based in slackware and uses shell to ask user and password.
View 1 Replies
View Related
Feb 18, 2011
I need to startup a program automatically. What to do? I using kubuntu. In Windows, you go to the startup folder under program files(I think.)
View 1 Replies
View Related
Apr 9, 2011
I have a script running as a cronjobIt outputs logs upon each run to /var/log/mylog.logIs there anyway I can delete this or compress it when it gets too large?A cheap and dirty way is to setup another cronjob to delete the log every X interval.... although I'm not sure if that's the proper way
View 3 Replies
View Related
Nov 4, 2010
I am using fedora 13. I need to start machine at 9 am and shut-down or hibernate it on 9 pm automatically. Is their is any way.In windows i found this way
View 6 Replies
View Related
Jul 4, 2011
whenever i hibernate or shut down my laptop,its touch pad automatically turns off..next time i login,i've to start it by pressing Fn+F8(which i think is my laptop custom shortcut).
View 5 Replies
View Related
Nov 23, 2010
I installed fedora core 10 on my pc & now i have been trying to install samba. I dont have a network so i mount and use my dvd for installation. I lack exotic package management tools like apt or yum yet the system-config-packages tool does not make sense either. so am stuck with the rpm -ivh [package] command.
The issue however is that this command returns querries about missing dependencies when I attempt to install. So is there a way (switch) i can add to tell the rpm command to automatically check and solve these dependecies using the Packages folder on my mounted dvd? - because i believe all these dependencies are on the dvd.
View 1 Replies
View Related
Aug 20, 2010
I have installed linux Mint as a first time user on an oldish laptop. How can I prevent it defaulting back to the user password screen when I am not using it for a few minutes? I'd be grateful for some pointers. Better still, can I get it t passwordautomatically?..i.e. remember password. I thought I had completed this step but it goes back to the user login which is quite annoying as I have to keep entering the password.
View 4 Replies
View Related
Apr 27, 2010
If I send data via scp, will scp automatically verify that the received data matches the sent data? I can do it manually with md5sum, but is that necessary?
View 3 Replies
View Related
Aug 13, 2009
Is there a way to resolve these dependencies automatically?
View 2 Replies
View Related
Jun 14, 2011
If I need certain programs such as ktorrent to start automatically on bootup, how do I do it?
View 1 Replies
View Related