Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Thursday, March 24, 2011

Install node.js on Ubuntu

The following will help you compile and install node.js on Ubuntu.

Install dependancies:
apt-get install g++ curl libssl-dev apache2-utils git-core

git the source:
git clone https://github.com/joyent/node.git

Compile node.js:
./configure
make
make install

Thursday, November 4, 2010

UFW Block outgoing traffic

I prefer to block outgoing traffic by default on public facing servers. I see a lot people being flamed for even asking how to do this with UFW.

The main reason you would want to do this is to prevent your machine from making reverse shell connections. A lot of attacks involve targeting a vulnerable web application that has a remote code execution vulnerability. If this attack was successful, the attacker could then download remote content to your machine or make a reverse shell connection, giving them shell access to your machine.

By blocking all outgoing traffic, you can prevent them from gaining remote access to your machine.

To do this with UFW:
ufw default deny outgoing
You can then allow individual outgoing ports if necessary. For example, you'll probably want to allow DNS queries to your name servers.
ufw allow out to 8.8.8.8 port 53
Where 8.8.8.8 is the address of the name server. This allows traffic from any local IP on the machine to your nameserver on port 53.


Sunday, June 13, 2010

Dell latitude: Enable middle click scroll on Ubuntu

It seems by default most, if not all, laptops with a pointing stick and a middle mouse button default to using paste for the middle mouse click assignment with XORG. You can change this so that it scrolls like it does on Windows.

Edit one of the files in /usr/lib/X11/xorg.conf.d/ or just create a new one and add:

Section "InputClass"
Identifier "Trackpoint Wheel Emulation"
MatchProduct "PS/2 ALPS DualPoint TouchPad"
MatchDevicePath "/dev/input/event*"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
Option "Emulate3Buttons" "false"
Option "XAxisMapping" "6 7"
Option "YAxisMapping" "4 5"
EndSection
Change MatchProduct to your pointing stick device. You can find the name of your device by running
xinput list
Log out and back in for it to take effect.



Friday, October 30, 2009

Ubuntu 9.10 Karmic Koala Upgrade No Sound

After upgrading to Ubuntu 9.10 Karmic Koala my system was without sound. Alsa couldn't find any sound cards.

00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01)

alsamixer: function snd_ctl_open failed for default: No such file or directory

aplay -l
aplay: device_list:223: no soundcards found...


After poking around I discovered that the updater did not update /boot/grub/menu.lst to use the latest installed kernel.

You can fix this automatically by running update-grub. Choose install package maintainer's version if you don't have any custom entries.

Saturday, October 17, 2009

Disable Apache and PHP Version on Ubuntu Server

Edit /etc/apache2/apache2.conf
Add the following lines to the end of apache2.conf
ServerTokens Prod
ServerSignature Off


Edit /etc/php5/apache2/php.ini
Change expose_php = Off

Tuesday, July 21, 2009

Tuesday, May 26, 2009

Ubuntu: Use apt-get through a proxy

You can set proxy settings in the Synaptic package manager but these don't seem to affect apt-get. To get apt-get to work through a proxy do:
sudo nano /etc/bash.bashrc
At the end of the file add:
export http_proxy=http://username:password@proxyserver:port/
export ftp_proxy=http://username:password@proxyserver:port/
If your proxy server does not require authentication then leave out the username:password@

You'll need to open a new terminal for it to take effect.

Sunday, April 26, 2009

no exec line in the session file: xfce4

After upgrading an Xubuntu 8.10 system to 9.04 xfce may no longer start properly. If you get the message:
no exec line in the session file: xfce4

In the failsafe terminal, type nano .dmrc
Change Session=xfce4 to Session=xfce

Restart the machine and xfce should start properly. To restart X without restarting the whole system, do sudo /etc/init.d/gdm stop. Switch to another terminal by doing alt+F2, login and then do sudo /etc/init.d/gdm start.

Friday, April 24, 2009

Ubuntu equivalent of rc-update

The Ubuntu equivalent of Gentoo's rc-update is update-rc.d

Gentoo example:
rc-update add ssh default

Ubuntu example:
update-rc.d ssh defaults

Sunday, December 7, 2008

Replacing network cards under Ubuntu: eth0 missing

If you change network adapters and are running Ubuntu you may notice that eth0 no longer exists but your new adapter shows up as eth1, or eth2, eth3, etc. To fix this, just clear the contents of /etc/udev/rules.d/70-persitent-net.rules and reboot.

Monday, November 24, 2008

Ubuntu: cannot find -lXxf86vm

/usr/bin/ld: cannot find -lXxf86vm

apt-get install libXxf86vm-dev

Ubuntu: cannot find -lasound

/usr/bin/ld: cannot find -lasound

apt-get install libasound-dev

Ubuntu: cannot find -lXv

/usr/bin/ld: cannot find -lXv
apt-get install libxv-dev