Common Unix / Linux file permissions – quick reference

 Linux - Ubuntu/Deb/etc  Comments Off on Common Unix / Linux file permissions – quick reference
Jun 102011
 

The most common permissions include:

400     r——–       files (won’t let you accidentally erase)

444     r–r–r–      files (lets everyone read)

600     rw——-     files (no one else can read or see files)

644     rw-r–r–      files (owner can read/write, group read, public read)

664     rw-rw-r–      files (owner can read/write, group read/write, public read)

666     rw-rw-rw-     files (owner can read/write, group read/write, public read/write)

700     rwx——          programs and directories (Owner r/w/execute)

750     rwxr-x—          programs and directories etc

755     rwxr-xr-x          programs and directories etc

777     rwxrwxrwx     programs and directories etc

 

Network upgrade for Ubuntu desktops

 Linux - Ubuntu/Deb/etc  Comments Off on Network upgrade for Ubuntu desktops
Jul 012010
 

Here are some quick info for updating Ubuntu from the command line that I used earlier.

Network upgrade for Ubuntu desktops (Recommended)

You can easily upgrade over the network with the following procedure.

  1. Start System/Administration/Update Manager.
  2. Click the Check button to check for new updates.
  3. If there are any updates to install, use the Install Updates button to install them, and press Check again after that is complete.
  4. A message will appear informing you of the availability of the new release.
  5. Click Upgrade.
  6. Follow the on-screen instructions.

Network upgrade for Ubuntu servers (Recommended)

  1. Install update-manager-core if it is not already installed:
    sudo apt-get install update-manager-core
    
  2. edit /etc/update-manager/release-upgrades and set Prompt=normal
  3. Launch the upgrade tool:
    sudo do-release-upgrade
  4. Follow the on-screen instructions.

Upgrade from 8.04 LTS to 10.04 LTS

Network upgrade for Ubuntu desktops (Recommended)

You can easily upgrade over the network with the following procedure.

  1. Press Alt-F2 and type update-manager --devel-release
  2. Click the Check button to check for new updates.
  3. If there are any updates to install, use the Install Updates button to install them, and press Check again after that is complete.
  4. A message will appear informing you of the availability of the new release.
  5. Click Upgrade.
  6. Follow the on-screen instructions.

Network upgrade for Ubuntu servers (Recommended)

  1. Install update-manager-core if it is not already installed:
    sudo apt-get install update-manager-core
  2. edit /etc/update-manager/release-upgrades and set Prompt=lts
  3. Launch the upgrade tool:
    sudo do-release-upgrade --devel-release
  4. Follow the on-screen instructions.

Other upgrade options exist, please view the Upgrade Notes to learn more.

Jun 152010
 

Simulating High Traffic

If your problem has to do with your memory usage spiking at certain times of the day, it can be hard to figure out what’s happening since things are often running well when you’re able to check on them. When that’s the case, it’s important to be able to simulate the environment that’s causing the problem. A great tool for this is the httperf command. This is a tool for UNIX-like operating systems that allows you to measure web server performance. This is a fairly complex tool that can do a lot, but the most simple usage would be something like this:

  httperf --hog --server=www.example.com --num-conns=1000 --rate=20 --timeout=5

That command will hit the supplied domain with 1000 connections at a rate of 20 connections per second. Connections that get no response within 5 seconds are dropped. The “–hog” parameter simply allows it to hog network ports on your system to allow for more outgoing connections. Depending on the amount of traffic you’re trying to simulate, you’ll need to adjust that.

So, to see what’s going on, you’ll likely want three terminal windows open. One will be SSH’d into your PS with top -c running sorted by memory (shift-m). Another will be SSH’d into your PS where you can repeatedly run free -m while httperf is running to monitor memory usage. And the third will be running httperf from your local machine (you do NOT want to run this from your PS itself).

This is great for profiling your sites and checking to see if caching is working. You can run this for each of your domains and see which ones affect your memory usage the most so you know where to focus your attention when working on optimizing things.

Another tool that can do something similar to this, but has fewer features is the Apache Benchmark tool. To use that you would use a command similar to this:

  ab -n 1000 -c 20 http://www.example.com

That would attempt to create 1000 connections to http://www.example.com limiting itself to 20 concurrent connections. Between both tools you should be able to get a good idea of what’s going on with your sites under higher traffic.

You can find links to get more information on httperf and Apache Benchmark in the #External Links section below.

Maverick Meerkat – Ubuntu 10.10 Release Schedule

 Linux - Ubuntu/Deb/etc  Comments Off on Maverick Meerkat – Ubuntu 10.10 Release Schedule
Jun 142010
 

seems i’m always the last to know…

Amber GranerTags:

Below is the Maverick Meerkat, Ubuntu 10.10 Release Schedule. Now you can mark your calendars and know when and where the milestones in the development cycle are. This should also allow Ubuntu users to keep an eye and ear open for all the wonderful and exciting things being developed. If you want to get involved in testing, or maybe you just want to download the Release Candidate prior to the final release. Now you can know what to expect and when. Should the schedule change I’ll correct here on You-In-Ubuntu as well.

Alpha 1 – June 3rd, 2010

Alpha 2 – July 1st, 2010

Alpha 3 – August 5th, 2010

Beta – September 2nd, 2010

Release Candidate – September 30th, 2010

Final Release – SUNDAY – October, 10, 2010

For more information on Ubuntu go to: http://www.ubuntu.com/

For more information on how you can participate in the Ubuntu Community got to: http://www.ubuntu.com/community

Please send your questions, comments, and suggestions to: amber [at] ubuntu-user [dot] com.

Jun 112010
 

Here’s something I used earlier..

Connecting to Remote Linux Desktop via SSH with X11 Forwarding

by Forrest Sheng Bao http://fsbao.net

There are two advantages of Linux, compared with many other operating systems, such as Windows and Mac OS X. The first advantage is the ultimate B/S architecture. Thus, everything software is either a server or a program running on a server. When clicking my mouse, I am talking to a server program called X Server on my box. When surfing Internet, I am using Firefox, a browser running on X Server. The second advantage is that you can always find many choices to achieve one goal. When I wanna connecting my Linux box remotely with a graphic desktop environment, I have many choice, VNC (or VNC over SSH, VNC over VPN), SSH with X-window enabled, xdmcp, etc. Here we will discuss how to connect to your Linux desktop via “ssh -X”. It’s very easy, you just need to type two more letters than common SSH connection.

Why “ssh -X”? Because the graphic rendering job is done at your client so the data to transfer thru network is not huge. You won’t feel the screen is delayed even when you play movies. And this won’t add your server much load, as the same reason, thus a lot of job is done by your client. So, this is a high efficiency solution for remote desktop. You even can run big commercial graphic software, like Xilinx ISE or Mathworks MATLAB, remotely. And, this supports multi-client, no matter using different username or same username, since you a connecting to a server, both SSH server and X server.

Of course, you need to properly install and configure your SSH server, which is on the same machine running your Linux graphic desktop environment (KDE, GNOME, Xfce, or whatever). Obviously, you MUST install your SSH server program. You can install it via “sudo apt-get install openssh-server” on Ubuntu Linux 7.10. I think you can easily figure out how to do so on other Linux distributions. Then edit the file /etc/ssh/ssh_config. Make these lines be in that configuration file:

ForwardAgent yes
ForwardX11 yes
ForwardX11Trusted yes

Now open /etc/ssh/sshd_config. Attention, the file name is sshd_config, not the same as previous one. Make sure this line be in this configuration file

X11Forwarding yes

Restart your SSH server. Now, go to your client computer, from which you will connect to this computer.

I have no idea on how to do next on Windows. If your client computer runs on Linux or Mac OS X, or other OS with X server running, go ahead.

If your client computer runs on Mac OS X, make sure that you have installed X11 for Mac OS X. Go to “Application”- > “Utilities” to start X11 and you will see an xterm terminal in front of you by default. If no such window, click “Applications” – > “Terminal”.

Now let’s simply type

ssh -X user_name@the_server_IP_or_hostname.domainame

. For example, if my server is www.example.com and my username is NSF, I simply type

ssh -X NSF@www.example.com

. Accept the RAS key and enter your password.

Have logged in? Ok, the big show is coming. If your desktop is GNOME, then just type

gnome-session

. What do you see? The GNOME desktop is in front of you. If your desktop is others, such as KDE or Xfce, please refer their docs on how to start them.

Try to something, and you will really find that the networked remote desktop is very fast. You can even play movies. No delay, right? As I just said before, the graphic rendering job is done at your client so the data to transfer thru network is not huge. It’s just like when you play a 3D network game, like World of Warcraft, only some instructions are transferred thru the Internet but not all 3D objects.

This is my desktop connecting to remote Linux box from a Mac. The left-top corner lays Xlinx ISE. The left-bottom is playing 2008 New Years Concert. I put the Mac info page over the Linux desktop. Like it? DIY, now!

SSh to Linux box from Mac

May 242010
 

Here is a blog post I have referred to a number of times recently in my adventures with Ubuntu.

Synaptic? deb? sudo? apt? Damn! I still remember when I first installed Ubuntu (my first encounter with Linux). But God bless Google, Ubuntu Forums, a few other resources and Blogs. Things became easier than I thought. Here, I will be posting a reference about Ubuntu things! And to end with top 5 Ubuntu resources on web for Ubuntu starters.

Privileges

sudo command – run command as root
sudo -s – open a root shell
sudo -s -u user – open a shell as user
sudo -k – forget sudo passwords
gksudo command – visual sudo dialog (GNOME)
kdesudo command – visual sudo dialog (KDE)
sudo visudo – edit /etc/sudoers
gksudo nautilus – root file manager (GNOME)
kdesudo konqueror – root file manager (KDE)
passwd – change your password

Display

sudo /etc/init.d/gdm restart – restart X and return to login (GNOME)
sudo /etc/init.d/kdm restart – restart X and return to login (KDE)
sudo dexconf – reset xorg.conf configuration
Ctrl+Alt+Bksp – restart X display if frozen
Ctrl+Alt+FN – switch to tty N
Ctrl+Alt+F7 – switch back to X display

System Services

(Prefix commands with sudo to run)

start service – start job service (Upstart)
stop service – stop job service (Upstart)
status service – check if service is running (Upstart)
/etc/init.d/service start – start service (SysV)
/etc/init.d/service stop – stop service (SysV)
/etc/init.d/service status – check service (SysV)
/etc/init.d/service restart – restart service (SysV)
runlevel – get current runlevel

Package Mangement

(Prefix commands with sudo to run)

apt-get update – refresh available updates
apt-get upgrade – upgrade all packages
apt-get dist-upgrade – upgrade with package
replacements; upgrade Ubuntu version
apt-get install pkg – install pkg
apt-get purge pkg – uninstall pkg
apt-get autoremove – remove obsolete packages
apt-get -f install – try to fix broken packages
dpkg –configure -a – try to fix broken packages
dpkg -i pkg.deb – install file pkg.deb
(file) /etc/apt/sources.list – APT repository list

Network

ifconfig – show network information
iwconfig – show wireless information
sudo iwlist scan – scan for wireless networks
sudo /etc/init.d/networking restart – reset
network for manual configurations
(file) /etc/network/interfaces – manual configuration
ifup interface – bring interface online
ifdown interface – disable interface

Special Packages

linux-headers-generic – latest build headers
ubuntu-desktop – standard Ubuntu environment
kubuntu-desktop – KDE desktop
xubuntu-desktop – XFCE desktop
ubuntu-minimal – core Ubuntu utilities
ubuntu-standard – standard Ubuntu utilities
ubuntu-restricted-extras – non-free, but useful
kubuntu-restricted-extras – KDE of the above
xubuntu-restricted-extras – XFCE of the above
build-essential – packages used to compile programs
linux-image-generic – latest generic kernel image

Applications Name

nautilus – file manager (GNOME)
dolphin – file manager (KDE)
konqueror – web browser (KDE)
kate – text editor (KDE)
gedit – text editor (GNOME)

System

lsb_release -a – get Ubuntu version
uname -r – get kernel version
uname -a – get all kernel information

Top 5 web resoureses for Ubuntu Starters

http://ubuntuforums.org/ (Great, helpful and most responsive community)

http://www.ubuntugeek.com/ (A lot of Tips and Tricks)

http://www.gnome-look.org/ (Add a little flavor to Gnome)

http://tombuntu.com/ (Nice Ubuntu Blog)

http://lifehacker.com/ (Not specific to Ubuntu but they have a lot of good Ubuntu articles)

And here is the bonus

http://fosswire.com/ (the source of above information)

Hope, this might help you in your Ubuntu venture. If you like the post, please Digg or Stumble it.

http://yabblog.com/2008/10/25/ubuntu-reference/  My source of this information.

May 162010
 

You may wish to check the git tutorial or Jeff Garzik’s Git tutorial before reading further. There’s also a very comprehensive guide to advanced git usage (“branch wizardry and git grandmastery” ; ) called Git Magic available; despite the name it also addresses Basic Trickery for the beginner’s needs. See also “Git – SVN Crash Course” at git.or.cz.

Came across these on the Wine site.. treacherous wine.. ;) Will post more as I find em.. though I think the subject is well covered in the above links..;)

Feb 172010
 

How to add a user to the sudoers list

Believe it or not, this is a fairly common question and in all reality the answer is quite simple. Adding a user to the sudoers list on a fully installed Linux system such as Debian is only possible via the command visudo. Users in the sudoers list are allowed the privileges to run commands and as the root user. In the following quick tutorial, we will show you how adding a new sudoer is quickly done.

  1. Open a Root Terminal and type visudo (to access and edit the list)
  2. Using the up/down arrows, navigate to the bottom of the sudoers file that is now displayed in the terminal
  3. Just under the line that looks like the following:
  4. root ALL=(ALL) ALL

  5. Add the following (replacing user with your actual username):
  6. user ALL=(ALL) ALL

  7. Now press Ctrl+X and press Y when promted to save

That’s it, your new user now has root privileges!

How to Tell What Version of Ubuntu You Are Running

 Linux - Ubuntu/Deb/etc  Comments Off on How to Tell What Version of Ubuntu You Are Running
Aug 222009
 

Thanks to the how to geek for this one..;)

Telling what version of Ubuntu you are running is extremely easy. You would commonly use this command to figure out if you are running Edgy after you upgraded from Dapper.

cat /etc/issue

Ubuntu edgy (development branch)

Note that the version numbers might change over time. I’m running the beta version so that’s what shows up when I run that command. Either way, it should be clear that you are running Edgy.

May 162009
 

Re: How to make directories writable?

Applications -> Accessories -> Terminal

Type:

sudo chmod -R 777 /opt/lampp/ for example

or

sudo chmod -R (for recursive ((don’t type this))) 755 is a bit safer as it does not allow a folder to be world writable. What that’d look like without my mess is:

sudo chmod -R 755 /public_html/wp/etc/etc

Or if you are logged in via FTP as the user that owns the web folders then you would usually right click (if you’re using a graphical FTP client) on the file or folder and either add the writes where you want them or in some cases just type the 755/777 etc.

Related External Links

%d bloggers like this: