General Linux Chat and Small Questions v. I broke my Arch Install
6,886 replies, posted
[QUOTE=IpHa;43091766]Script Time!
For those of you with an Asus Xonar DG sound card, I wrote a script that will automatically patch and install the new modules.
[code]BASH
[/code][/QUOTE]
We should make a usefull scripts thread. I have a bunch that are extreemly usefull for everyday use.
[QUOTE=AlphaGunman;43091566]I think so, yeah.
[editline]6th December 2013[/editline]
It was hanging at boot on "[ X ] Reached target Graphical Interface".
[editline]6th December 2013[/editline]
Xorg.0.log told me this:
[code][ 11.991] (EE) NVIDIA: Failed to load the NVIDIA kernel module. Please check your
[ 11.991] (EE) NVIDIA: system's kernel log for additional error messages.
[ 11.991] (EE) No devices detected.
[ 11.991] (EE)
Fatal server error:
[ 11.991] (EE) no screens found(EE)
[ 11.991] (EE)
[/code]
[editline]6th December 2013[/editline]
In my desperate fumbling attempts to repair it I probably reinstalled the nvidia drivers five times, uninstalled GNOME and installed KDE.[/QUOTE]
Aren't the (EE) style errors from Xorg, though? Try regenerating your xorg.conf file. If that doesn't work, try using the nouveau driver in it instead of nvidia (temporarily) until you've found a fix.
[editline]6th December 2013[/editline]
Also, this thread might help, even though it's Ubuntu:
[url]http://ubuntuforums.org/showthread.php?t=1480660[/url]
[QUOTE=Mega1mpact;43092423]We should make a usefull scripts thread. I have a bunch that are extreemly usefull for everyday use.[/QUOTE]
We used to have one back when we had a linux section, it was awesome.
Oh right, we used to have a whole section... forgot about that.
[QUOTE=IpHa;43091766]Script Time!
For those of you with an Asus Xonar DG sound card, I wrote a script that will automatically patch and install the new modules.
[code]#!/bin/bash
_kernver=$(uname -r | cut -d- -f 1)
_basever=$(uname -r | cut -d. -f -2)
[ -e "linux-${_basever}.tar.xz" ] || wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-${_basever}.tar.xz
[ -e "patch-${_kernver}.xz" ] || wget https://www.kernel.org/pub/linux/kernel/v3.x/patch-${_kernver}.xz
[ -e "xonar-01.patch" ] || wget https://gist.github.com/ipha/7831385/raw/69e172eb9336f9371a8fab6300ff2cbeaf622851/xonar-01.patch
[ -e "xonar-02.patch" ] || wget https://gist.github.com/ipha/7831385/raw/c23e88245d8ee3ea09fe5607496ee2d833aa3053/xonar-02.patch
[ -e "xonar-03.patch" ] || wget https://gist.github.com/ipha/7831385/raw/25d4d2a55eac9f64b84eb36bf41428f499f9a8bb/xonar-03.patch
[ -e "xonar-04.patch" ] || wget https://gist.github.com/ipha/7831385/raw/47c0206fa8a3451ed0bd99aa97b0adb288346631/xonar-04.patch
[ -d "linux-${_basever}" ] && rm -r "linux-${_basever}"
tar xf linux-${_basever}.tar.xz
cd linux-${_basever}
xzcat ../patch-${_kernver}.xz | patch -Np1
patch -Np1 -i ../xonar-01.patch
patch -Np1 -i ../xonar-02.patch
patch -Np1 -i ../xonar-03.patch
patch -Np1 -i ../xonar-04.patch
cd sound/pci/oxygen
make -C /usr/lib/modules/$(uname -r)/build M="$(pwd)" modules
find -name "*.ko" -exec gzip {} \;
[ -d /usr/lib/modules/$(uname -r)/updates ] || sudo mkdir /usr/lib/modules/$(uname -r)/updates
sudo cp *.ko.gz /lib/modules/$(uname -r)/updates/
sudo depmod -a
pulseaudio --kill
sudo rmmod snd-oxygen
sudo rmmod snd-oxygen-lib
sudo modprobe snd-oxygen
pulseaudio --start
[/code][/QUOTE]
Bookmarked. Got that card so it should be useful. What's different?
[QUOTE=benbb;43093238]Bookmarked. Got that card so it should be useful. What's different?[/QUOTE]
Hardware volume control for headphones
Front panel support
Microphone support
[IMG]http://i.imgur.com/UAFTG9C.png[/IMG]
Hmm.. Doesn't work, or am I being stupid.
I haven't tested it outside of arch, what distro are you using?
Mint 16.
[QUOTE=IpHa;43093442]I haven't tested it outside of arch, what distro are you using?[/QUOTE]
From his hostname I'd say Mint.
Change every instance of "/usr/lib" to "/lib"
Seems to be working, thanks! Not too much difference for me though.
Thanks for the help anyhow.
Alsamixer seems to have an option for Headphone Impedence but it does fuck all. Don't know if the ALSA team are ever going to get that working.
The Xonar DG doesn't actually have a real headphone amp, it's just something they simulate with the windows driver.
Really? It's advertised as having one. That's why I bought it in the first place. Ah well, works fine on Windows.
I guess I shouldn't say it doesn't have an amp. It does have a line driver for the headphone output, but the switchable impedance thing is just a gimmick created in the driver.
[QUOTE=AlphaGunman;43092024]Alright. What should the "nvidia.conf" file contain?[/QUOTE]
[CODE]nvidia[/CODE]
All it will do is force the module to be loaded at boot time, before your desktop manager.
Everything works now. Thanks, ben1066 and FPtje.
[QUOTE=Mega1mpact;43092423]We should make a usefull scripts thread. I have a bunch that are extreemly usefull for everyday use.[/QUOTE]
[url]https://github.com/silverhammermba/scripts[/url]
if you're going somewhere without an ethernet connection, be sure your computer is capable of connecting to wpa-secured networks [i]before[/i] you're stuck without internet because you can't install the right tools
[QUOTE=AlphaGunman;43100780]if you're going somewhere without an ethernet connection, be sure your computer is capable of connecting to wpa-secured networks [i]before[/i] you're stuck without internet because you can't install the right tools[/QUOTE]
either that or always bring a phone with lots of battery, 3G/4G, and internet tethering. That's what I do, plus the above.
[QUOTE=AlphaGunman;43100780]if you're going somewhere without an ethernet connection, be sure your computer is capable of connecting to wpa-secured networks [i]before[/i] you're stuck without internet because you can't install the right tools[/QUOTE]
I did that last week... ended up downloading the packages I needed on my ipod.
[QUOTE=Larikang;43100190][url]https://github.com/silverhammermba/scripts[/url][/QUOTE]
Why ruby instead of bash!?
Seriously... [url]https://github.com/silverhammermba/scripts/blob/master/capture.rb[/url]
[QUOTE=Mega1mpact;43101033]Why ruby instead of bash!?
Seriously... [url]https://github.com/silverhammermba/scripts/blob/master/capture.rb[/url][/QUOTE]
You can get a ruby interpreter just about anywhere, and it seems to have similar constructs to bash with respect to invoking other programs (i.e. exec and backticks). Why not use your favorite language in your scripts?
[QUOTE=Rayjingstorm;43101072]You can get a ruby interpreter just about anywhere, and it seems to have similar constructs to bash with respect to invoking other programs (i.e. exec and backticks). Why not use your favorite language in your scripts?[/QUOTE]
Because bourne-compatible-ish shells are so ubiquitous? Sure, it's not [I]difficult[/I] to get ruby but getting it for simple scripts like this seems pointless.
i don't know enough about shell scripting to use it honestly
i just use python for everything
Is it actually worth learning Vala for any reason? It seems like something that could be useful.
[QUOTE=esalaka;43101187]Because bourne-compatible-ish shells are so ubiquitous? Sure, it's not [I]difficult[/I] to get ruby but getting it for simple scripts like this seems pointless.[/QUOTE]
If the script is trivial, porting to (ba)sh is nontrivial, so there is no problem writing it in something else.
If the script is really non-trivial, it may not be worth it to write it in (ba)sh, so there is no problem writing it in something else.
Somewhere in the middle there it's up in the air whether the cost of writing in (ba)sh is worth the potential for non-portability, but for your own personal scripts I think it's just as well to always write in something else. I personally write in bash just because I do think it is one of the best "glue" languages out there, and you don't have to switch contexts from normal shell operations just to write a small script, but I could see myself using python for a lot of similar tasks.
[editline]7th December 2013[/editline]
For example, I run backups over SSH using rsync; my script is ~30 lines of bash to glue some stuff together and maintain a symlink to the latest backup on the remote host. In this case it is easier to use bash because I can put the script on any box and start using it immediately without worrying about dependencies (bash, ssh, rsync are all ubiquitous).
I also use a script to sync my music collection with an external player; I maintain a (largely) FLAC library, but want to use ogg/mp3 on my player due to storage constraints. Rather than write a script myself I looked around and found [url=https://bitbucket.org/ghorvath/music-collection-sync]a nice script[/url] to do just what I needed, with a lot of stuff I didn't think I needed but appreciate. It's on the order of ~300 lines of python; I'm comfortable reading this, but a version in bash would be a pain, in my opinion. There is no real issue with portability because python is only [i]slightly[/i] less common than bash. In fact, this script runs on windows boxes, too, where python is actually more common than bash, so you might say the python version is more portable.
I have 4 servers running linux and I kinda want to manage them all through one single user interface (web or something).
Can you guys recommend something?
[QUOTE=Mega1mpact;43101033]Why ruby instead of bash!?
Seriously... [url]https://github.com/silverhammermba/scripts/blob/master/capture.rb[/url][/QUOTE]
Well, I admit that script is silly. It used to do more stuff, but I'm in the middle of figuring out a better way to do that.
As for the others, I know Ruby better than bash. I think it's more readable and just about as succinct. It's definitely less efficient, but who cares about that when it's just a convenience script?
[QUOTE=Larikang;43102780]It's definitely less efficient, but who cares about that when it's just a convenience script?[/QUOTE]
And it's not necessarily less efficient, either.
Sorry, you need to Log In to post a reply to this thread.