суббота, 24 ноября 2012 г.

Fedora and broadcom b43 wireless and b44 wired drivers

Tricks, tricks, tricks... They are always present when you are working with linux systems.
This may be actual for =< Fedora 17. There is great fedoraforum.org article about broadcom wireless drivers.
Open b43 (broadcom wireless) driver seems can work together with b44 (broadcom wired) driver, but not too well. On high load, for example - torrents, he can do such error:
ping: sendmsg: No buffer space available

And after that you may reload wireless or a whole system to make work it again. So temporary solution is to unload b44 module when wireless needs to be more stable at work.
Way to unload right now:
 sudo modprobe -v -r b44  
And we will get something like this:
 rmmod b44  
 rmmod mii  
Also for a long term it possible add to blacklist:
 sudo vim /etc/modprobe.d/blacklist.conf  
 blacklist b44  
p.S. Seems there is interesting solution with broadcom-wl drivers. This could also work with b43.

четверг, 15 ноября 2012 г.

jQuery UI in Drupal7

From the first sight looks easy but a bit tricky. Ok, we wanna use jQuery UI.
Yes, drupal7 has jquery ui in its core. But:
1) Its in old version. Because of that examples from http://jqueryui.com/ may not work. So we have to use jQuery update.
2) Its not enabled by default.
We need to insert to our code function:

 drupal_add_library('system', 'ui');  

Now we can try jquery ui coding.

воскресенье, 26 августа 2012 г.

Apache and mysql service bash aliases


ap - i mean apache service
and
my - i mean mysql service

 cd  
 vim .bashrc  

Paste next lines:

 alias apstart="sudo systemctl start httpd.service"  
 alias apstop="sudo systemctl stop httpd.service"  
 alias aprestart="sudo systemctl restart httpd.service"  
   
 alias mystart="sudo systemctl start mysqld.service"  
 alias mystop="sudo systemctl stop mysqld.service"  
 alias myrestart="sudo systemctl restart mysqld.service"  

Thats it.

пятница, 24 августа 2012 г.

Vim gnome desktop file

Example .desktop file to select vim terminal editor for your files in the Open with other application dialog is (also you can found it at the "Programs" gnome3 meny tab):



 [Desktop Entry]  
 Encoding=UTF-8  
 Name=Vim Text Editor (Console)  
 Comment=Edit text files in a console using Vim  
 Exec=vim %u  
 Terminal=true  
 Type=Application  
 Icon=/usr/share/pixmaps/vim.png 
 Categories=Application;Utility;TextEditor;  
 StartupNotify=true  
 MimeType=text/plain;  
 NoDisplay=false  

Save it as:
~/.local/share/applications/vim.desktop

Also I used that icon for vim. And put file into:

/usr/share/pixmaps/

Fedora post installation guide

Some simple tricks, some details are always forget. Good idea to update guide  in nearest future. Skype, vim files...

Yum update

Fastest mirror yum plugin. RPM download should be faster.
 su -c 'yum install yum-fastestmirror'  

Anyway we can now add rpmfusion repos:

 su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm'  


Update

 su -c 'yum update -y'  

Configuring sudo

While update going on we can configure sudo.
 su --login -c 'vim /etc/sudoers'  

Look for line:
 root ALL=(ALL) ALL  
and than add this after it:
 username ALL=(ALL) ALL  
Where "username" is you current system username.

Also we should not need ask for pass when using sudo.
Comment this line:

 # %wheel ALL=(ALL) NOPASSWD: ALL  


And uncomment this:

 #%wheel ALL=(ALL)    NOPASSWD: ALL  


Done, save file and exit.

Add user to wheel group

 su -c 'gpasswd -a username wheel'  

Check it

 $ sudo whoami  

Alias

Lets do simple aliases.

 cd   
 vim .bashrc   


Add this lines:

alias update="sudo yum update" 
alias install="sudo yum install" 
alias upgrade="sudo yum upgrade" 
alias remove="sudo yum remove" 




Done.

MS fonts

Maybe a good idea. Download rpm.



Packages are might be useful:


 sudo yum -y install mc vim p7zip unrar wget evince-djvu gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-ugly gstreamer-ffmpeg  



You also may want to install fixed fonts and configure gnome terminal:

 install bitmap-fixed-fonts  



...and isntall nautilus terminal extention.

 install nautilus-open-terminal  







понедельник, 16 июля 2012 г.

Sublime Text 2 fedora manual install


Ok, here is my trick. Nothing serious, just some additional preferences.
Download original file from developer site.
Move directory to /opt


 sudo mv Sublime\ Text\ 2 /opt/sublime2  


Lets check it:


 cd /opt/sublime2 

 tree  


Next is /usr/bin sublime file:


 touch /usr/bin/sublime 

 chmod 755 /usr/bin/sublime  


Lets edit it to start sublime from /opt directory:


 gedit /usr/bin/sublime  


Add these lines to /usr/bin/sublime file:


 #!/bin/sh 

 export SUBLIME_HOME="/opt/sublime2" 

   

 $SUBLIME_HOME/sublime_text $*  


Thats good. Now sublime command should work from terminal.
Next is .desctop file:


 sublime /usr/share/applications/sublime.desktop  


You should paste these lines:


 [Desktop Entry] 

 Encoding=UTF-8 

 Name=Sublime 

 Comment=Sublime Text Editor 

 Exec=sublime %U 

 Icon=/opt/sublime2/Icon/128x128/sublime_text.png 

 Terminal=false 

 Type=Application 

 Categories=GNOME;Application;Development; 

 StartupNotify=true 

 MimeType=text/plain;  


Finish. System restart and logout are not necessarily.