воскресенье, 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