the Rainbow Networks
RN|VQ3 DEFRAG
Map: pornstar-15percent
Players: 0 / 18

+++eXy FFA
Map: unitooldm4
Players: 2 / 18
The golden pot › RAINBOW NETWORKS › Tech & Support › ... Linux Tips ...
... Linux Tips ...
Something wrong with our servers or your system?
Go to page 1, 2, 3  Next
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexTech & Support
View previous topic :: View next topic  
Author Message
Falkland
Übergod
Übergod


Joined: Aug 01, 2008
Posts: 922
Location: Nowhere

PostPosted: Fri Oct 16, 2009 10:54 pm    Post subject: ... Linux Tips ... Reply with quote

- Sometime it can happen that a server hang up , for example, for a memory leak so when Linux runs low on memory it tries to kill applications. It can happen that also the sshd can be killed so making the server unaccessible from remote : here's a tip to protect sshd by the action of the OOM killer.

- Installing a kernel based on the latest 2.6.31 release can make many sensors to stop working. This workaround could help to have sensors back.
Back to top
View user's profile
Falkland
Übergod
Übergod


Joined: Aug 01, 2008
Posts: 922
Location: Nowhere

PostPosted: Sat Oct 17, 2009 11:28 pm    Post subject: Re: ... Linux Tips ... Reply with quote

- Linux Shell Scripting Tutorial
- Ubuntu Security Features ( wiki )
- Debian Hardening Guidelines ( wiki )
- The Gentoo Hardened Toolchain
- Top 20 OpenSSH Server Best Security Practices
Back to top
View user's profile
Falkland
Übergod
Übergod


Joined: Aug 01, 2008
Posts: 922
Location: Nowhere

PostPosted: Thu Oct 22, 2009 4:46 pm    Post subject: Re: ... Linux Tips ... Reply with quote

Starting and stopping USB external disks via console :

Code::
sudo sdparm --command=start|stop /dev/sdX 

The command could also be inserted in a backup script :

- sdparm --command=start /dev/sdX
- mount /dev/sdX $MOUNT_POINT
- exec $BACKUP_SCRIPT
- umount /dev/sdX
- sdparm --command=stop /dev/sdX
Back to top
View user's profile
kernel_panic
Übergod
Übergod


Joined: Aug 28, 2007
Posts: 751
Location: uk

PostPosted: Fri Oct 30, 2009 4:18 pm    Post subject: Re: ... Linux Tips ... Reply with quote

Octave/Matlab-like search history behaviour in bash, as God intended it to be. You type the first characters and press UP arrow to browse past commands that start with those characters...Completely different and MUCH better than CTRL+R.


Some permutations of this may be necessary to get it working.

_________________
"Fuelling off topic babble since day 1."
Back to top
View user's profile
Falkland
Übergod
Übergod


Joined: Aug 01, 2008
Posts: 922
Location: Nowhere

PostPosted: Wed Dec 02, 2009 1:11 am    Post subject: Re: ... Linux Tips ... Reply with quote

Dunno if this can help because I am quite sure none has to deal with NFS here ... anyway

The nfs server init script contained in the Debian SID distribution doesn't start the server with a kernel of the 2.6.32 series ( actually the latest is the rc8 ) , even if the kernel has full nfs support.

This is caused by a check made in the init script ( /etc/init.d/nfs-kernel-server ) that scans the kernel symbol table for finding the presence of the nfsd support :

Code::
...
		# See if our running kernel supports the NFS kernel server
		if [ -f /proc/kallsyms ] && ! grep -qE 'init_nf(sd|	)' /proc/kallsyms; then
			log_warning_msg "Not starting $DESC: no support in current kernel."
			exit 0
		fi
...

init_nfs and init_nfsd symbols were removed in the latest (forthcoming) kernel version , maybe it's better saying that the symbols are not exported anymore.

Anyway this modification to the init script is strictly needed to start correctly the NFS server: bugs.debian.org/cgi-bi...bug=550153

Code::
...
		# See if our running kernel supports the NFS kernel server
		if [ ! -f /proc/fs/nfs/exports ]; then
		    log_warning_msg "Not starting $DESC: no support in current kernel."
		    exit 0
		fi
...

The change should be introduced in the next nfs-kernel-server package : packages.debian.org/un...nel-server
Back to top
View user's profile
jackthompson
Admin
Admin


Joined: Aug 15, 2007
Posts: 1302
Location: Here

PostPosted: Thu Dec 03, 2009 2:03 pm    Post subject: Re: ... Linux Tips ... Reply with quote

convert all images to jpg

Code::
#!/bin/bash
#
#
set_suffix()
{
  echo ${1%.*}${2}
}
for F in "$@";do
	convert "$F" "$(basename "$(set_suffix "$F" ".jpg")")"
done

convert all images to png

Code::
#!/bin/bash
#
#
set_suffix()
{
  echo ${1%.*}${2}
}
for F in "$@";do
        convert "$F" "$(basename "$(set_suffix "$F" ".png")")"
done

Code::
#!/bin/sh
#
# scale an image to 1x1 and back to old size
#   effectively reducing the colors to a single avg. color
#

for F in $@; do
SIZE=`convert -verbose -scale 1x1 "$F" temp.tga`
SIZE=${SIZE#* }
SIZE=${SIZE#* }
SIZE=${SIZE%% *}
  convert -scale $SIZE temp.tga "$F"
done

Code::
#!/bin/bash
#
# find dead symlinks
#

find . -type l | (while read F ; do test -e "$F" || ls -ld "$F"; done)

Code::
#!/bin/bash
#
# USAGE: dumper.sh FILE [START] [LEN]
#
# shows the byte-count in hex and dec
#

FILE=${1}
START=${2}
LEN=${3}


dump ()
{
  #  _a[dox]  Display the input offset, cumulative across input files, of the next byte to be displayed.
  #           The appended characters d, o, and x specify the display base as decimal, octal or
  #           hexadecimal respectively.
  hexdump -v -e '"%08_ad  %08_ax  "' -e '16/1 "%02x "' -e '"  "' -e '16/1 "%_p"' -e '"\n"' ${@}
}

if [[ ${START} == "" && ${LEN} == "" ]]; then
  dump ${FILE}
  exit
fi

if [[ ${LEN} == "" ]]; then
  dump -s ${START} ${FILE}
  exit
fi

dump -s ${START} -n ${LEN} ${FILE}


exit


Code::
#!/bin/sh
#
# rename filenames to lower-case
#
for F in "$@"; do
	echo "mv \"${F}\" \"$(echo "${F}" | tr [:upper:] [:lower:])\""
done

Code::
#!/bin/sh
#
# grayscale an image
#

for F in $@; do
  convert "$F" -colorspace Gray gray_"$F"
done

stupid seamonkey doesn't open-in-browser anymore... :(


Last edited by jackthompson on Tue Feb 02, 2010 12:38 am; edited 1 time in total
Back to top
View user's profile
Falkland
Übergod
Übergod


Joined: Aug 01, 2008
Posts: 922
Location: Nowhere

PostPosted: Fri Dec 04, 2009 6:54 pm    Post subject: Re: ... Linux Tips ... Reply with quote

jackthompson wrote:

... stupid seamonkey doesn't open-in-browser anymore... :(

it's a combination of the new mozilla policy about MIME/types and the new sandbox
Back to top
View user's profile
jackthompson
Admin
Admin


Joined: Aug 15, 2007
Posts: 1302
Location: Here

PostPosted: Sat Dec 05, 2009 12:34 am    Post subject: Re: ... Linux Tips ... Reply with quote

Falkland wrote:
jackthompson wrote:

... stupid seamonkey doesn't open-in-browser anymore... :(

it's a combination of the new mozilla policy about MIME/types and the new sandbox

ah...

and i use nfs a lot :D
Back to top
View user's profile
Falkland
Übergod
Übergod


Joined: Aug 01, 2008
Posts: 922
Location: Nowhere

PostPosted: Mon Feb 01, 2010 9:00 pm    Post subject: Re: ... Linux Tips ... Reply with quote

I had to export a qemu/kvm image in virtualbox few days ago , so I had to operate an image convertion from qcow2 format to vdi format.

Here's the general instructions for converting virtual images formats :

- Convert from qcow/qcow2 to vmdk and vdi

qcow/qcow2 -> vmdk ( VMware disk format ) : qemu supports vmdk format natively , so it's enough using qemu-img command :

Code::
~$ qemu-img convert disk_image.img -O vmdk disk_image.vmdk

qcow/qcow2 -> vdi ( VirtualBox disk format ) : qemu does not support vdi disk format , so we need first to convert qcow/qcow2 image into raw image format and then coverting raw image to vdi :

Code::
~$ qemu-img convert disk_image.img -O raw disk_image.raw
~$ vboxmanage convertdd disk_image.raw disk_image.vdi

Note 1 : the latest version of VirtualBox actually supports also vmdk disk format
Note 2 : the latest version of vboxmanage utility converts directly in the VDI variable size format
Note 3 : pay attention to have enough space disk when you operate any of those conversion , expecially when converting to raw image format ( eg a compressed qcow image of 400 MB but with a real dimension of 8GB will be expanded in a raw image of 8GB )
Note 4 : vboxmanage is the convention used in the OSE package , while the same utility is named VBoxManage in Sun binary package. Also syntax may be different ( replace convertdd with convertfromraw )

- Convert from vmdk to qcow/qcow2 and vdi

vmdk->qcow/qcow2

Code::
~$ qemu-img convert -f vmdk disk_image.vmdk -O qcow/qcow2  disk_image.img

vmdk->vdi

Code::
~$ qemu-img convert -f vmdk disk_image.vmdk -O raw disk_image.raw
~$ vboxmanage convertdd disk_image.raw disk_image.vdi
Back to top
View user's profile
Joki
Übergod
Übergod


Joined: Apr 16, 2008
Posts: 1037
Location: at tiled stove

PostPosted: Tue Feb 02, 2010 12:28 pm    Post subject: Re: ... Linux Tips ... Reply with quote

Here is a GEOS-wiki, in case you might wanna toss your PC out and give the good old commodore and its "windows" a chance.

en.wikipedia.org/wiki/...ng_system)

www.c64-wiki.de/index.php/GEOS

_________________
Back to top
View user's profile Visit poster's website
Falkland
Übergod
Übergod


Joined: Aug 01, 2008
Posts: 922
Location: Nowhere

PostPosted: Wed Feb 03, 2010 1:34 am    Post subject: Re: ... Linux Tips ... Reply with quote

DeJa Dup : an easy backup utility for ubuntu ( and maybe other distributions ) : it uses duplicity , an utility for encrypted and incremental backups ( rsync based )
Back to top
View user's profile
PopeJo
Übergod
Übergod


Joined: Oct 05, 2007
Posts: 931
Location: precise!

PostPosted: Wed Feb 03, 2010 1:45 am    Post subject: Re: ... Linux Tips ... Reply with quote

/me marks this thread as unread

_________________
LOGIC, n.
The art of thinking and reasoning in strict accordance with the limitations and incapacities of the human misunderstanding. (Devil's dictionary)
Back to top
View user's profile Visit poster's website ICQ Number
Falkland
Übergod
Übergod


Joined: Aug 01, 2008
Posts: 922
Location: Nowhere

PostPosted: Mon Feb 08, 2010 10:21 pm    Post subject: Re: ... Linux Tips ... Reply with quote

- Basic IpTables Tutorial

- Easy Firewall Generator for IPTables ( Use as a skeleton for editing your own firewall )

- www.pettingers.org/cod...ewall.html

EDIT : more resources

- A more complete tutorial

- www.gentoo.org/doc/en/...mp;chap=12

- Xtables addons :
Quote::

Xtables-addons is the successor to patch-o-matic(-ng). Likewise, it contains extensions that were not, or are not yet, accepted in the main kernel/iptables packages.

Xtables-addons is different from patch-o-matic in that you do not have to patch or recompile the kernel, sometimes recompiling iptables is also not needed. But please see the INSTALL file for the minimum requirements of this package.

Xtables addons are available in debian SID ( xtables-addons-common , xtables-addons-source for respectively iptables user space extensions and iptables kernel modules source packages : to compile kernel modules just use module-assistant )
Back to top
View user's profile
Falkland
Übergod
Übergod


Joined: Aug 01, 2008
Posts: 922
Location: Nowhere

PostPosted: Mon Feb 22, 2010 7:50 pm    Post subject: Re: ... Linux Tips ... Reply with quote

Sometimes can happen that for a compilation process or git update process or every other process that eats up memory like hell , your system could need more swap space , expecially if it has a low amount of memory and you don'twant your process to be killed for beeing out of memory

In linux you can add swap space on the fly as you need .

Open a root shell , create an empty file and then activate swap :

Code::

sh# dd if=/dev/zero of=temp-swap.img count=1000000

sh# mkswap ./temp-swap.img

sh# swapon ./temp-swap.img


The commands above create an empty file of 512MB , then format the file to be used as a swap space file and finally activate the new swap file which space will be added to the existant swap space . You can see that by inspecting the /proc/swaps file :

Code::
sh# cat /proc/swaps 

You should always have a swap partition also when you have enough memory and expecially for laptops because without a swap partition your system will be not able to hybernate. In this case you need at least a swap partition that has a size equal to the amount of your RAM ( eg 4GB )
Back to top
View user's profile
SnooSnoo
Übergod
Übergod


Joined: Aug 18, 2007
Posts: 1453
Location: Croatia

PostPosted: Mon Feb 22, 2010 11:09 pm    Post subject: Re: ... Linux Tips ... Reply with quote

And thank god they are finaly moving from a partiton based swap to a file based swap system. ;)

_________________
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page     Forum Index -> Tech & Support All times are GMT + 1 Hour
Go to page 1, 2, 3  Next
Page 1 of 3


Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Welcome Anonymous


Membership:
Latest: kontol
New Today: 0
New Yesterday: 0
Overall: 355

People Online:
Members: 0
Visitors: 35
Total: 35
Who Is Where:
 Visitors:
01: The golden pot
02: The golden pot
03: The golden pot
04: Rainbow Media
05: The golden pot
06: The golden pot
07: The golden pot
08: Home
09: The golden pot
10: The golden pot
11: The golden pot
12: Home
13: Home
14: The golden pot
15: Home
16: Home
17: The golden pot
18: The golden pot
19: The golden pot
20: The golden pot
21: Home
22: The golden pot
23: Maps
24: The golden pot
25: Rainbow Media
26: Maps
27: The golden pot
28: The golden pot
29: The golden pot
30: My Account
31: Maps
32: Maps
33: The golden pot
34: The golden pot
35: The golden pot

Staff Online:

No staff members are online!

The Rainbow Networks website is hosted by JockeTF and Soder on furver.se.

The Rainbow Networks
Interactive software released under GNU GPL, Code Credits, Privacy Policy
Azul theme and related images designed by Jamin