Miralinux Blog

  • Home
  • Linux
    • Scripts
    • CentOS
  • Apple
  • Microsoft
    • Features
    • Office
    • Windows
  • Learning
  • Games
  • Multimedia
    • XBMC
  • Other
    • About WordPress
  • Links
    • General
    • Software
      • Autocad
    • Hardware
      • BIOS
    • Linux
    • WiKieS

Monthly Archives: June 2010

Linux: Hardware info

Posted on 2010/06/30 by arno Posted in Linux, Uncategorized

yum install lshw

lspci
lshw | less
lshw -C network
dmidecode | less

cat /proc/cpuinfo
cat /proc/devices
cat /proc/meminfo
dmesg |grep eth

linux network interface reorder eth*

learn awk: http://www.ibm.com/developerworks/library/l-awk1.html

source: http://www.science.uva.nl/research/air/wiki/LogicalInterfaceNames

source: http://www.reactivated.net/writing_udev_rules.html

Linux

Manage Linux log files with Logrotate

Posted on 2010/06/29 by arno Posted in Linux

source: http://articles.techrepublic.com.com/5100-10878_11-1052474.html

Takeaway: Learn how to use the Logrotate program to administer, back up, and monitor log files on Linux.

Log files are the most valuable tools available for Linux system security. The logrotate program is used to provide the administrator with an up-to-date record of events taking place on the system. The logrotate utility may also be used to back up log files, so copies may be used to establish patterns for system use. In this Daily Drill Down, I’ll cover the following topics:

  • The logrotate configuration
  • Setting defaults for logrotate
  • Using the include option to read other configuration files
  • Setting rotation parameters for specific files
  • Using the include option to override defaults

The logrotate program
The logrotate program is a log file manager. It is used to regularly cycle (or rotate) log files by removing the oldest ones from your system and creating new log files. It may be used to rotate based on the age of the file or the file’s size, and usually runs automatically through the cron utility. The logrotate program may also be used to compress log files and to configure e-mail to users when they are rotated.

The logrotate configuration
The logrotate program is configured by entering options in the /etc/logrotate.conf file. This is a text file, which may contain any of the configuration options listed in the table below. The options entered in /etc/logrotate.conf may be used to set configuration parameters for any log file on the system. These options may also be used to allow logrotate to read configuration parameters from other log files, by using the include parameter.

Option
Function
compress This is used to compress the rotated log file with gzip.
nocompress This is used when you do not want to compress rotated log files.
copytruncate This is used when processes are still writing information to open log files. This option copies the active log file to a backup and truncates the active log file.
nocopytruncate This copies the log files to backup, but the open log file is not truncated.
create mode owner group This rotates the log file and creates a new log file with the specified permissions, owner, and group. The default is to use the same mode, owner, and group as the original file.
nocreate This prevents the creation of a new log file.
delaycompress When used with the compress option, the rotated log file is not compressed until the next time it is cycled.
nodelaycompress This overrides delaycompress. The log file is compressed when it is cycled.
errors address This mails logrotate errors to an address.
ifempty With this, the log file is rotated even if it is empty. This is the default for logrotate.
notifempty This does not rotate the log file if it is empty.
mail address This mails log files that are cycled to an address. When mail log files are cycled, they are effectively removed from the system.
nomail When mail log files are cycled, a copy is not mailed.
olddir directory With this, cycled log files are kept in the specified directory. This directory must be on the same filesystem as the current log files.
noolddir Cycled log files are kept in the same directory as the current log files.
prerotate/endscript These are statements that enclose commands to be executed prior to a log file being rotated. The prerotate and endscript keywords must appear on a line by themselves.
postrotate/endscript These are statements that enclose commands to be executed after a log file has been rotated. The postrotate and endscript keywords must appear on a line by themselves.
daily This is used to rotate log files daily.
weekly This is used to rotate log files weekly.
monthly This is used to rotate log files monthly.
rotate count This specifies the number of times to rotate a file before it is deleted. A count of 0 (zero) means no copies are retained. A count of 5 means five copies are retained.
tabootext [+] list This directs logrotate to not rotate files with the specified extension. The default list of extensions is .rpm-orig, .rpmsave, v, and ~.
size size With this, the log file is rotated when the specified size is reached. Size may be specified in bytes (default), kilobytes (sizek), or megabytes (sizem).

The /etc/logrotate.conf file
The /etc/logrotate.conf file is the default configuration file for logrotate. The default /etc/logrotate.conf file installed with Red Hat Linux is shown below:
# see “man logrotate” for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# send errors to root
errors root
# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress
1
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own lastlog or wtmp –we’ll rotate them here
/var/log/wtmp {
monthly
create 0664 root utmp
rotate 1
}

/var/log/lastlog {
monthly
rotate 1
}

# system-specific logs may be configured here

Setting defaults for logrotate
Default configuration settings are normally placed close to the beginning of the logrotate.conf file. These settings are usually in effect system-wide. The default settings for logrotate on this system are established in the first 12 lines of the file.

The third line
weekly

specifies that all log files will be rotated weekly.

The fifth line
rotate 4

specifies that four copies of old log files are retained before the files are cycled. Cycling refers to removing the oldest log files and replacing them with new copies.

The seventh line
errors root

sends all logrotate error messages to root.

The ninth line
create

configures logrotate to automatically create new log files. The new log files will have the same permissions, owner, and group as the file being rotated.

The eleventh line
#compress

prevents logrotate from compressing log files when they are rotated. Compression is enabled by removing the comment (#) from this line.

Using the include option
The include option allows the administrator to take log file rotation information, which may be installed in several files, and use it in the main configuration file. When logrotate finds the include option on a line in logrotate.conf, the information in the file specified is read as if it appeared in /etc/logrotate.conf.

Line 13 in /etc/logrotate.conf
include /etc/logrotate.d

tells logrotate to be read in the log rotation parameters, which are stored in the files contained in the /etc/logrotate.d directory. The include option is very useful when RPM packages are installed on a system. RPM packages’ log rotation parameters will typically install in the /etc/logrotate.d directory.

The include option is important. Some of the applications that install their log rotation parameters to /etc/logrotate.d by default are apache, linuxconf, samba, cron, and syslog. The include option allows the parameters from each of these files to be read into logrotate.conf.

Using the include option in /etc/logrotate.conf allows the administrator to configure a rotation policy for these packages through a single configuration file.

Using include to override defaults
When a file is read by /etc/logrotate.conf, the rotation parameters specified in the include will override the parameters specified in the logrotate file. An example of /etc/logrotate.conf being overridden is shown below:
#Log rotation parameters for linuxconf
/var/log/htmlaccess.log
{ errors jim
notifempty
nocompress
weekly
prerotate
/usr/bin/chattr -a /var/log/htmlaccess.log
endscript
postrotate
/usr/bin/chattr +a /var/log/htmlaccess.log
endscript
}
/var/log/netconf.log
{ nocompress
monthly
}

In this example, when the /etc/logrotate.d/linuxconf file is read by /etc/logrotate.conf, the following options will override the defaults specified in /etc/logrotate.conf:
Notifempty
errors jim

The nocompress and weekly options do not override any options contained in /etc/logrotate.conf.

Setting parameters for a specific file
Configuration parameters for a specific file are often required. A common example would be to include a section in the /etc/logrotate.conf file to rotate the /var/log/wtmp file once per month and keep only one copy of the log. When configuration is required for a specific file, the following format is used:
#comments
/full/path/to/file
{
option(s)
}

The following entry would cause the /var/log/wtmp file to be rotated once a month, with one backup copy retained:
#Use logrotate to rotate wtmp
/var/log/wtmp
{
monthly
rotate 1
}

Although the opening bracket may appear on a line with other text or commands, the closing bracket must be on a line by itself.
Using the prerotate and postrotate options
The section of code below shows a typical script in /etc/logrotate.d/syslog. This section applies only to /var/log/messages. On a production server, /etc/logrotate.d/syslog would probably contain similar entries.
/var/log/messages
{
prerotate
/usr/bin/chattr -a /var/log/messages
endscript
postrotate
/usr/bin/kill -HUP syslogd
/usr/bin/chattr +a /var/log/messages
endscript
}

The format for this script uses the following methods:

  • The first line, /var/logmessages, declares the file for which this script will be used.
  • The curly braces,{ }, are used to enclose the entire script. All commands contained within these braces will be run on the /var/log/messages file.
  • The prerotate command specifies actions to be taken prior to the file being rotated by logrotate.
  • The command /usr/bin/chattr -a is run to remove the append-only attribute from /var/log/messages.
  • The endscript command marks the end of the prerotate portion of this script.
  • The next line, postrotate, specifies the following commands are to be run on /var/log/messages after the file has been rotated by logrotate.
  • The command /usr/bin/killall -HUPsyslogd is run to reinitiate the system logging daemon, syslogd.
  • The next command, /usr/bin/chattr +a /var/log/messages, reassigns the append-only attribute to the /var/log/messages file. This means the file may only be seen in append mode. This prevents the file from being overridden by any other program or user.
  • The endscript command appears on a line by itself and marks the end of the postrotate portion of this script.
  • The last curly brace,}, marks the end of commands to be applied to the /var/log/messages file.

Running logrotate
There are three steps involved in running logrotate:

  1. Identify the log files on your system.
  2. Create rotation schedules and parameters for the log files.
  3. Run logrotate through the cron daemon.

The code below shows the default cronjob shipped with Red Hat Linux to allow logrotate to run daily:
#/etc/cron.daily/logrotate
#! /bin/sh

/usr/sbin/logrotate /etc/logrotate.conf

This cronjob allows logrotate to run daily with the rotation parameter specified in /etc/logrotate.conf.

Conclusion
Log rotation is the first step in log file management. The logrotate utility provides the Linux administrator with the ability to maintain a log file rotation policy and to retain copies of log files to assist in establishing patterns related to system usage. In this Daily Drill Down, we looked at the installation and configuration of logrotate, used the include option to read configuration files related to RPM packages, and ran logrotate as a cronjob. We also discussed the proper methods for restarting logrotate after the log rotation procedure is completed.
The authors and editors have taken care in preparation of the content contained herein but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for any damages. Always have a verified backup before making any changes.

Linux

VMware error vCenter Server: “Error Parsing the server“

Posted on 2010/06/22 by arno Posted in Uncategorized

vCenter Server: “Error Parsing the server “192.168.0.100″ “clients.xml” file Login will continue contact your system administrator“

source: http://forum.advance.homelinux.net/index.php?topic=10063.0

source: http://blog.verlande.nl/2009/05/vmware-vsphere-client-op-windows-7-build-7127/

Na het installeren van de vSphere client op mijn 64 bits Windows 7 virtual machine, kreeg ik de volgende error te zien toen ik verbinding wilde maken met mijn vCenter Server: “Error Parsing the server “192.168.0.100″ “clients.xml” file Login will continue contact your system administrator“. Nadat ik op “OK” geklikt had kreeg ik vervolgens de tweede error voor mijn kiezen: “The type initializer for “VirtualInfrastrcture.Utils.HttpWebRequestProxy” threw an exception“. Wat Googlen leerde me snel dat het niet mogelijk was om de vSphere client werkend te krijgen, zonder hierbij gebruik te maken van een workaround. Sommigen brachten als oplossing het gebruiken van de Windows XP modus aan. Dit werkt alleen niet als je het wil gebruiken in een reeds gevirtualiseerde omgeving, zoals in mijn geval op mijn ESX host. Daarom kwam ik snel uit op een stappenplan wat iemand op het VMware Communities forum aandroeg. Na wat gepuzzle met config files, x86-paths en andere tweaks is het me gelukt om de vSphere client aan de praat te krijgen op Windows 7 x64 (Build 7127). Dit is hoe:

  1. Kopieer de System.dll van een systeem waar geen Windows 7, maar waar wel .NET 3.5 SP1 op staat geinstalleerd, naar de Windows 7 computer. Deze DLL is te vinden in de map %SystemRoot%\Microsoft.NET\Framework\v2.0.50727\ op de non-Windows 7 computer (voor de mensen die niet zo snel een .NET 3.5 SP1 installatie klaar hebben staan, daar geen zin in hebben of het lekker makkelijk willen hebben, mijn System.dll online gezet).
  2. Maak een directory aan op de Windows 7 computer waar de VMware vSphere Client geinstalleerd staat, en kopieer de DLL-file van stap 1 naar deze map. Ikzelf heb C:\Program Files (x86)\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\Lib\ gebruikt om mijn DLL-file in te zetten. Deze map ga ik later ook nog gebruiken om een tweetal scriptjes in te plaatsen, welke verderop besproken worden.
  3. In de vSphere Client Launcher directory staat de VpxClient.exe.config file. Open deze in een tekst editor en voeg een runtime-element toe (de rood gekleurde tekst), en sla het bestand daarna op.
  4. Maak een batch file (bijvoorbeeld vpxclient.bat) door in een tekst file een drietal regels te typen en deze vervolgens op te slaan als “vpxclient.bat” inclusief de quotes, om de bestandsextensie te behouden. Deze regels bevatten een commando om de DEVPATH variabele naar de folder te verwijzen van stap 2.Voorbeeld:
    @ECHO OFFSET DEVPATH=C:\Program Files (x86)\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\Lib"C:\Program Files (x86)\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\VpxClient.exe"
  5. Door vervolgens bovenstaande vpxclient.bat uit te voeren als Administrator, wordt de VMware vSphere Client opgestart en is het mogelijk om in te loggen op de ESX-host of de vCenter Server.
VMware

iPhone tweaks disable call forwarded/forwarding messages

Posted on 2010/06/22 by arno Posted in Uncategorized

Now connect to your iphone using Putty (or whatever, you can even use the terminal on the iPhone itself)
and browse to the following directory: /System/Library/Carrier Bundles/Unknown.bundle/

Before you do anything, make a backup of the carrier.plist file:
cp carrier.plist carrier.plist.bck

The carrier.plist file is unreadable in firmware 2.2, so convert it to something readable with:
plutil -convert xml1 carrier.plist

Now use vim or nano to change the “ShowCallForwarded” and “ShowCallForwarding” keys
to “false”.

This leaves all forwarding configuration alone, but just disables that pesky message.
For the fun of it, type “reboot” in your terminal, wait a couple of minutes for your iPhone to reboot,
place a call and verify that the popup message is gone!! wh00t!

source: http://weyland.be/wrdprss/index.php/2008/11/24/disable-call-forwarding-active-popup-on-iphone-22/
source: http://modmyi.com/forums/file-mods/13589-removing-call-forwarding-active-pop-up-message.html

Apple iPhone

Links

Posted on 2010/06/14 by arno Posted in Links

http://www.marinetraffic.com/ais/nl/default.aspx
http://www.flightradar24.com/
http://casper.frontier.nl/
http://www.topbits.com/public-dns-servers.html

Links

Windows XP Hardware devices network device manager

Posted on 2010/06/09 by arno Posted in Uncategorized

KB269155 – Error message when you try to set an IP address on a network adapter

KB311272 – DevCon command-line utility functions as an alternative to Device Manager

KB Microsoft

PXE and Kickstart, Automated Installations for Linux via WDS

Posted on 2010/06/04 by arno Posted in Linux

source: http://www.ohjeah.net/2008/09/24/pxe-and-kickstart-automated-installations-for-linux-via-wds/

Links Microsoft Server 2008

Windows Deployment Services WDS

Posted on 2010/06/04 by arno Posted in Uncategorized

Deploy WDS XP/pre-Vista/7 images using WDS

source: http://social.technet.microsoft.com/forums/en-US/winserversetup/thread/592025de-8566-4660-8c57-ecb83bf4629a/

You can use the WDS capture utility to deploy XP or any other pre-Vista Windows images using WDS.

More information in the WDS whitepaper here: http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=1393400&SiteID=17

See chapter ‘working with images‘, ‘Deploying Earlier Versions of Windows‘.

1. Install XP to a reference computer
2. On the server, add a boot image and create a ‘capture image’
3. sysprep the reference computer. Reboot it to download the ‘capture image’ from the WDS server
4. Follow the instructions to upload the XP image from the reference computer to the server

One key challenge is that XP images are HAL-dependent, so you’ll need multiple images for deploying to computers with different HALs.

WDS in Windows Server 2003:

  • WDS 2003 Step by Step Guide – http://go.microsoft.com/fwlink/?LinkId=66145
  • Deploying and Managing the Windows Deployment Services Update on Windows Server 2003 – http://go.microsoft.com/fwlink/?LinkId=81031

WDS in Windows Server 2008

You can download this content at http://go.microsoft.com/fwlink/?LinkId=89381, or you can browse it using the following links:

  • WDS 2008 Step by Step Guide – http://go.microsoft.com/fwlink/?LinkId=84628
  • Deployment content – http://go.microsoft.com/fwlink/?LinkId=81873
  • Technical Reference content – http://technet2.microsoft.com/windowsserver2008/en/library/80e4c10d-bb4b-4337-81dd-aa98fe6db7351033.mspx?mfr=true
Update1:

Moving default image store in WDS

source: http://www.techtalkz.com/windows-deployment/197581-moving-default-image-store-wds.html

You can move the drive and files from a command prompt:

C:\>  wdsutil /uninitialize-server

Move the remoteinstall directory to another drive.

C:\> wdsutil /initialize-server /reminst:drive\remoteinstall

Migrating to windows 7

Posted on 2010/06/04 by arno Posted in Uncategorized

Migrating Files During a Remote Installation with USMT and Windows Deployment Services

Upgrading from Windows XP to Windows 7

Upgrading from Windows Vista to Windows 7

Links Microsoft

Mobile internet providers APN settings

Posted on 2010/06/02 by arno Posted in Office, Uncategorized

– Vodafone
– Xs4all

– Vodafone mifi R201 – http://www.business.vodafone.com/site/bus/public/enuk/support/10_productsupport/wi_fi_devices/r201/05_summary/p_summary.jsp

Custom APN settings phone-internet providers netherlands
– Pluk’n’play

ALDI TALK

  • APN: MEDIONmobile Handyweb
  • Account Name: [leeg laten]
  • Password: [leeg laten]

Ben

  • APN: internet.ben
  • Account Name: [leeg laten]
  • Password: [leeg laten]

Hi

  • APN: basicinternet [of] fastinternet
  • Account Name: [leeg laten]
  • Password: [leeg laten]

KPN

  • APN: internet
  • Account Name: KPN
  • Password: gprs

KPN (als bovenstaande niet werkt)

  • APN: portalmmm.nl
  • Account Name: [leeg laten]
  • Password: [leeg laten]

KPN

  • APN: basicinternet [of] fastinternet
  • Account Name: [leeg laten]
  • Password: [leeg laten]

Orange

  • APN: internet
  • Account Name: orange, of: [leeg laten]
  • Password: orange, of: [leeg laten]

Simyo

  • APN: basicinternet
  • Account Name: [leeg laten]
  • Password: [leeg laten]

Telfort

  • APN: internet
  • Account Name: telfort
  • Password: telfort

T-Mobile

  • APN: internet
  • Account Name: tmobile
  • Password: tmobile

Vodafone Particulier

  • APN: live.vodafone.com
  • Account Name: vodafone
  • Password: vodafone

Vodafone Zakelijk (met compressie)

  • APN: office.vodafone.nl
  • Account Name: vodafone
  • Password: vodafone

Vodafone Zakelijk (zonder compressie)

  • APN: web.vodafone.nl
  • Account Name: vodafone
  • Password: vodafone

Vodafone Blackberry

  • APN: blackberry.vodafone.nl
  • Account Name: vodafone
  • Password: vodafone
iPhone Mobile
  • Login
  • Mother of all Portals
  • .Handy .Handig
  • Links – wikis – wikies

Archives

  • June 2022
  • October 2021
  • June 2021
  • September 2016
  • April 2016
  • March 2016
  • November 2014
  • September 2014
  • August 2014
  • July 2014
  • April 2014
  • March 2014
  • November 2013
  • October 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • February 2013
  • December 2012
  • September 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
CyberChimps ©2025