CategoryLinux

Hardening linux

Check those links if you want to be ontop of the securuty

  • CIS Benchmarks – contains requirements from the Center for Internet Security (CIS) benchmarks.
  • DCID – contains requirements from the Director of Central Intelligence Directives (DCID).
  • DISA UNIX STIG – contains modules that address DISA UNIX Security Technical Implementation Guides (STIGs) security recommendations.
  • FERC CIP – contains modules that address the Critical Infrastructure Protection (CIP) standards for electricity distributors.
  • JAFAN – the Joint Air Force-Army-Navy (JAFAN) manual established the security policy and procedures for storing, processing, and communicating classified Department of Defence (DoD) Special Access Program (SAP) information in information systems.
  • NISPOM – contains modules that address the National Industrial Security Program Operating Manual (NISPOM).
  • PCI DSS – Payment Card Industry Security Standards Council includes members from Visa, MasterCard, American Express, Discover, and JCB International Credit Card Company. This council administers the Data Security Standard (DSS).
  • Web Services Protection – contains modules that address standard security functionality to provide protection.

IBM tutorial

Emulate3buttons

Faithful to the rule that I must blog everything that took me more than 15min searching in google I am here again.

This time the post is related to my notebook which mousepad doesnt support double tap (poor lenovo :) )

Emulate3buttons – this is the magic key. Wonder how to use it? Just click left+right at the same time.

Also be aware: in the new distros this setting is not changed from xorg.conf  check this article

http://www.seebs.net/log/articles/459/disabling-emulate3buttons-on-ubuntuleft+left+right clicks right clicks

The rest is a copy/paste from the post above

The problem is that you can’t just override this in xorg.conf anymore. You need to use xinput. xinput’s powerful, clever, flexible… and totally over the heads of a lot of users. Here’s a script to run from .xinitrc or the equivalent which disables Emulate3Buttons on any input devices which have it. (It’s now called “Middle Button Emulation”, mind.)

#!/bin/sh
xinput list | sed -ne 's/^[^ ][^V].*id=\([0-9]*\).*/\1/p' | while read id
do
        case `xinput list-props $id` in
        *"Middle Button Emulation"*)
                xinput set-int-prop $id "Middle Button Emulation" 8 0
                ;;
        esac
done

How this works: We first obtain a list of ID numbers, disregarding those where the second character on the line was V, because xinput list-props doesn’t work on the "Virtual[...] lines for the generic keyboard and mouse. For each such device, we check to see whether it has the feature; if so, we disable it. (The number 8 indicates that we’re setting an 8-bit value; it doesn’t really matter. The disabled state is 0.)

Fonts for coders

guda@guda-laptop:~$ sudo mkdir /usr/share/fonts/myfonts
guda@guda-laptop:~$ cd myfonts/
guda@guda-laptop:~/myfonts$ sudo cp *.ttf /usr/share/fonts/myfonts/
guda@guda-laptop:~/myfonts$ sudo fc-cache -f
guda@guda-laptop:~/myfonts$

Font sources:

 

Make X11 fonts available to Java

Perform one of the following:

  1. Open /etc/profile and add a new environment variableJAVA_FONTS=/usr/share/fonts/truetype
    export JAVA_FONTS
  2. Open font.properties file under jre/lib directory, uncommnent and set to the appropriate font directoryappendedfontpath=/usr/share/fonts/truetype

Mod Rewrite, mod_rewrite

Found great summary of mod rewrite here

http://stackoverflow.com/questions/286004/hidden-features-of-modrewrite

 

I aways forget the params for mod_rewrite so here is the summary

  • [R] force a redirect (default 301)
  • [R=302] force a 302 redirect
  • [L] stop rewriting process (see note below in common pitfalls)
  • [NC] case insensitive matches

Ubuntu (9.0.4) on Dell Optiflex 320

To install ubuntu on Dell system you need to change the default boot loader to grub2 or something else
#change the root password to something that you know
sudo passwd
#become root
su

mkdir /media/ubuntu
mount /dev/sda1 /media/ubuntu

# check that you have mounted the right partition.
ls /media/ubuntu

mount -t proc none /media/ubuntu/proc
mount -o bind /dev/ /media/ubuntu/dev
cp /etc/resolv.conf /mediaubuntu/etc

chroot /media/ubuntu /bin/bash
/etc/init.d/networking restart
aptitude update
aptitude install grub2

upgrade-....<tab>

My Ubuntu workstation configuration

XOrg configuration

  • https://wiki.ubuntu.com/X/Config/Resolution
  • cvt 1680 1050 75
  • xrandr –newmode …the output from cvt
    xrandr –newmode “1680x1050_75.00” 187.00 1680 1800 1976 2272 1050 1053 1059 1099 -hsync +vsync
  • xrandr –addmode DVI-0 1680x1050_75.00

Lenovo Y510

You have to install the latest alsa.

Then replace the existing kernel modules with the just build one. Then run depmod -a as point kilbasar here

http://ubuntuforums.org/showthread.php?t=687663&page=2

sudo su
cd /lib/modules/2.6.22-14-generic/ubuntu/media/snd-hda-intel/
mv snd-hda-intel.ko snd-hda-intel.ko.bak
ln -s /lib/modules/2.6.22-14-generic/kernel/sound/pci/hda/snd-hda-intel.ko /lib/modules/2.6.22-14-generic/ubuntu/media/snd-hda-intel/snd-hda-intel.ko
cd /usr/src/alsa/alsa-driver-1.0.16rc2/modules
cp * /lib/modules/2.6.22-14-generic/kernel/sound/
depmod -a

Logitech Revolution MX

http://x4.6times7.org/dokuwiki/doku.php/devlog/blog/howto_logitech_mx_revolution_on_ubuntu

  • The mouse wheel control
    • Download from here http://goron.de/~froese/revoco/ or revoco-0.5.tar
    • make
    • sudo ./revoco manual=6
    • lets try to add it in ~/.xprofile next time
  • Here is my xorg.conf
Section "Monitor"
 Identifier "External DVI"
 # 1680x1050 74.89 Hz (CVT 1.76MA) hsync: 82.31 kHz; pclk: 187.00 MHz
 Modeline "1680x1050_75.00"  187.00  1680 1800 1976 2272  1050 1053 1059 1099 -hsync +vsync
 # 1680x1050 59.95 Hz (CVT 1.76MA) hsync: 65.29 kHz; pclk: 146.25 MHz
 Modeline "1680x1050_60.00"  146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync
 # 1680x1050 69.88 Hz (CVT) hsync: 76.58 kHz; pclk: 174.00 MHz
 Modeline "1680x1050_70.00"  174.00  1680 1800 1976 2272  1050 1053 1059 1096 -hsync +vsync
 Option "PreferedMode"    "1280x1024_75.00"
EndSection

Section "Screen"
 Identifier    "Configured Screen Device"
 Device    "Configured Video Device"
 SubSection "Display"
 Depth    24
 Modes "1680x1050" "1024x768" "640x480"
 Virtual    2960 1050
 EndSubSection
EndSection

Section "Device"
 Identifier    "Configured Video Device"
 Option    "Monitor-DVI-0" "External DVI"
EndSection

My Development setup commands

I noticed simillar post here

sudo aptitude install mc vim subversion screen pidgin meld curl links2 vim-ruby vim-gnome vim-doc vim-scripts vim-ruby vim-perl \
subversion git-core bluefish kompozer\
libmysqlclient15off libmysqlclient15-dev mysql-common mysql-client \
libmysql-ruby1.8 irb ruby1.8 rdoc ri rake \
apt-utils build-essential ruby1.8-dev mysql-server memcached libxslt1-dev libpcre3-dev zlib1g-dev unzip gzip mytop openssl \
libopenssl-ruby libmagick9-dev imagemagick librmagick-ruby1.8 imagemagick librmagick-ruby-doc  libmagick9-dev ruby1.8-dev \
libdbd-sqlite3-ruby libsqlite3-ruby sqlite3 libsqlite3-dev

ln -s /usr/bin/ruby1.8 /usr/bin/ruby

mkdir ruby_install
cd ruby_install
wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
tar xzvf ruby*
cd rubygems-1.3.5
ruby setup.rb
cd ..
cd ..

ln -s /usr/bin/gem1.8 /usr/bin/gem

gem install rails mysql mongrel mongrel_cluster rails paperclip will_paginate andand \
json feed-normalizer hpricot mechanize ruby-debug uuid ruport ruport-util acts_as_reportable \
rufus-scheduler annotate openwferu-scheduler production_log_analyzer capistrano-ext libxml-ruby twitter capistrano wirble RedCloth
rspec-rails sqlite3-ruby \
--no-ri --no-rdoc

gem install rmagick -v 1.15.12
ruby -rrubygems -e "require 'RMagick'; puts Magick::Long_version;"

cat > /home/guda/.irbrc
require 'rubygems'
require 'wirble'
Wirble.init
Wirble.colorize
require 'logger'
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER')
Object.const_set('RAILS_DEFAULT_LOGGER', Logger.new(STDOUT))
end

Gmail notification
http://www.workswithu.com/2009/10/06/gmail-notifier-applets-for-ubuntu/

What about http://ubuntu-tweak.com/

Tools for calibrating LCD monitors

http://www.lagom.nl/lcd-test/black.php

Synergy – one keyboard for two PC-s

Synergy lets you easily share a single mouse and keyboard between multiple computers with different operating systems, each with its own display, without special hardware. It’s intended for users with multiple computers on their desk since each system uses its own monitor(s).”

root@guda-desktop:/etc# cat synergy.conf

section: screens
desktop:
guda-laptop:
end

section: aliases
guda-laptop:
192.168.1.101
end

section: links
desktop:
right = desktop
guda-laptop:
left = guda-laptop
end

# synergys –config /etc/synergy.conf
# synergyc IP

On windows I am defining:

“Share this computer…” -> configure

Screens: desktop, guda-laptop

links: guda-laptop is left on desktop and the oposite

Updates: Check the http://code.google.com/p/synergy-plus/ clone

MSI notebook are total scrab

For MSI Notebooks

Don’t buy MSI. Look for HP, IBM or some real brand.

  1. The lid of the laptop is breaking – I have  MSI 3 laptops and all of them are broken. One of my friends has the luck to return his laptop and now he is with a nice HP machine – lucky man. It was 6 months for repairing.
  2. The wireless is loosing connection all the time. My wife is with IBM and she is chating chating chating, and I am reconnecting, reconnecting reconecting….
    Update:The MSI lan adaptor has gone away. The only way to use Internet is via the integrated broken wireless. I hate MSI.
  3. The heat is like an oven – my son don’t want to play NFS because of the heat. Me too.
  4. The LCD screen gets on some dark and light spots very soon
  5. The material for the laptop is not good – not nice to touch. The silver color is quickly gone and ugly black places are shown
  6. If you enable the 32 bit access mode Linux kernel wont work (tested till ubunto 8.10
    1. After such try you must remove the battery start the power without any AC and return the power – is this magic ?
  7. The fan of the notebook is making awfull noise. The fan costs 40EUR and there no garantee that the new fan will be the same like the old one.
    1. The fan never stops
  8. Their support is not answering on ANY of the problems pointed here. maybe all from MSI are dead. Who knows.
  9. The microphone is very quiet and the this makes it impossible to talk with skype, btw why they have put the camara then?
  10. The mouse which they give as a bonus doesnt work – both 2 are broken, missing some clicks from time to time.
  11. Try searching for “MSI fan” in google. I got this result. Internet is full of “happy” MSI owners.

CHEAP RUBBISH !

I want my money back! for all 2 laptops that I have bought.

I will publish some pictures soon.

blah

Logs monitoring

I have been asked from one my friends who hosts many websites on single machine to help him to find which vhost is doing some slow requests.

the load of the machine from 0.5 has become 1.5. and there are some apache processess eating the CPU.

It is obvious that some php file is slowing down all the machine but who?

I found this wonderfull tool in Internet

http://code.google.com/p/wtop/wiki/Installing

http://code.google.com/p/wtop/wiki/LogrepCookbook

With this script I can monitor all the pages and not sitting in the dark while some evil pages are drying the CPU power.

logrep -m tail -f 'msec>1000' -o 'ts,ip,msec,class,url' *.log

© 2024 Gudasoft

Theme by Anders NorénUp ↑