Random Linux

Linux, video games and web hosting

This article aims to be a more updated and clear instructional on how to install the Easycap video capture device in Ubuntu and it’s variants . Given the price of these capture devices and there relatively good video quality they are fairly popular devices, at an average cost of $10-$15 how can you not pick one up to at least check it out. Until not to recently there wasn’t a great deal of support for the devices and what support and drivers there were weren’t always the greatest for all of the Easycap versions and hardware.

The old driver had bad video quality and compatibility for all hardware types is pretty low and finicky. Additionally you had to use their capture software piped through Mplayer to capture video unless you installed the slightly more finicky kernel patch. And that is what I will be guiding you through now is installing the current stable kernel module you will need to properly install and use your Easycap device in ubuntu.

Description

Linux kernel module driver for the Somagic Easycap capture device.

  • EasyCAP Model DC60, with CVBS, S-VIDEO, AUDIO(L), and AUDIO(R) inputs. The uninitialized device shows in lsusb as “1c88:0007 Somagic, Inc.”. Once initialized, it shows as “1c88:003c Somagic, Inc”.
  • EzCAP USB 2.0, with unlabeled CVBS, S-VIDEO, AUDIO(L), and AUDIO(R) inputs. The device is initialized automatically and shows in lsusb as “1c88:003d Somagic, Inc”.
  • EasyCAP Model 002 (or EasyCAP002), with 1, 2, 3, 4, and unlabeled microphone inputs. The uninitialized device shows in lsusb as “1c88:0007 Somagic, Inc.”. Once initialized, it shows as either “1c88:003e Somagic, Inc” or “1c88:003f Somagic, Inc”.

Identification

Indentify the device before buying

It is hard to identify the chipset of any EasyCAP device before buying because most onlineshops (ebay, amazon) do not mention in the provided technical data the chipset of the device. Example from logilik.de where the chipset is declared

Identify device using installation instructions for Windows
Windows-installer.png

If the chipset is not mentioned in device specifications on the website, one way to figure out the chipset inside the EaysCAP is to read through the installation instructions for Windows (if provided for download).

Screenshots of the windowsinstaller often reveal the devicename.

  • STK1160 EasyCAP is in Windows: (Syntek) STK1160 or STK1150
  • Empia EasyCAP is in Windows: USB 2861 Device or EMP
  • Somagic EasyCAP is in Windows: SM-USB 007 or SMI Grabber Device
  • UTV007 based EasyCAP is in Windows: USBTV007e

Known Easycap devices

 STK1160 EasyCAP

For the stk1160 based EasyCAPs exists another article on this wiki with further information.

It is assumed that the stk1160 based “EasyCAP DC60” ist the “originally” EasyCAP device. This device is sold in different varieties (models) and even under different names like: EzCap, LogiLink, Mumbi, Weltbild, and some more.

Components Used

  • Syntek STK1160 (USB video bridge)
  • Silan SC8113 or GM7113 (Philips SAA7113 compatible video decoder)
  • AC’97 audio processor (In the 4 inputs model this chip is missing. Audio capturing is done by the STK1160 chips built-in ADC for mono microphone audio recording.)

Indentification

# lsusb
Bus 001 Device 003: ID 05e1:0408 Syntek Semiconductor Co., Ltd STK1160 Video Capture Device

Making it work

STK1160 based devices are supported (video and audio) under Linux by the easycap kernel module (kernel 2.6.38 and later) and further on by the stk1160 kernel module (kernel 3.7). More information on this wiki: Stk1160

Audio support

More information on this wiki: Stk1160#Drivers

 


Empia EasyCAP

The Empia EasyCAP is based on the EM2860 chip from Empia.

Components Used

  • Empia EM2860 (EM2861 ?) (USB video bridge)
  • Silan SC8113 (Philips SAA7113 compatible video decoder)
  • AC’97 audio processor

Indentification

# lsusb
Bus XXX Device XXX: ID eb1a:2861 eMPIA Technology, Inc.

Making it work

EM2860 (EM2861) based devices are supported in Linux by the em28xx kernle module. More information on this wiki: Em28xx_devices

Audio support

The em28xx kernel module should create a Em28xx Audio ALSA soundcard which can be used for sound capturing.

 


 Somagic EasyCAP

The Somagic EasyCAP is based on the SMI-2021 chip from Somagic. It needs a firmware for operation.

Components Used

  • Somagic SMI-2021CBE (USB video bridge)
  • SAA7113 compatible video decoder
  • Cirrus Logic 5340-CZZ audio processor

Indentification

# lsusb
Bus XXX Device XXX: ID 1c88:0007 Somagic, Inc. 
and after loading the firmware
# lsusb
Bus XXX Device XXX: ID 1c88:003c Somagic, Inc. or Bus XXX Device XXX: ID 1c88:003f Somagic, Inc.

Making it work

For SMI-2021 based devices exists a proceeding Linux-driver project: easycap-somagic-linux which this tutorial explains the installation process for Ubuntu. Continue to the installation portion of this instructional

More information on this wiki: Somagic

Audio support

Audio support is provided by the easycap-somagic-linux driver at an unknown stage.


USBTV007 EasyCAP

This EasyCAP is based on a single UTV007 labeled chip.

This device is sold as “USB video capture QS702” from SHENZHEN FUSHICAI ELECTRONIC CO.,LTD

lsusb reports

  • Manufacturer: Fushicai
  • Product: usbtv007

 Components Used

  • Single chip: UTV007 A614231.1 1136L1BK
  • Inscriptions on the board: FSC VIDEO DVR

Indentification

# lsusb Bus XXX Device XXX: ID 1b71:3002

Full lsusb -v

Making it work

Linux kernel driver, enable CONFIG_VIDEO_USBTV: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/media/usb/usbtv

  • From 3.11 (“Linux for Workgroups”) on: Supports NTSC, Composite input
  • From 3.12 : S-Video input, Fixed deinterlacing, Throw corrupted frames away
  • From 3.13 (rc5) : PAL support
  • In works: Controls (brightness, …)

Also, a very experimental (for testing purposes only) userspace driver is available on github: http://github.com/memeruiz/usbtv007

  • Currently doesn’t do anything beyond what kernel driver does
  • Written using Python libusb1 and v4l bindings
  • Requires v4l loopback
  • Could be useful for easy protocol testing, prototypin
Audio support

A work in progress on the audio support can be found at: https://github.com/simon3z/usbtv

Status: tested and working for composite input (48Khz 2ch 16bit).

Work needed

  • Testing and fixing of eventual bugs is very welcome!
  • Audio is currently not supported on the last Linux kernel. Audio is working with the Windows driver (tested on Windows 2000 with the XP driver not on a virtualized computer with a playstation PSX for the video and audio inputs with the software “honestech HD DVR 2.5”).

The Windows driver shipped with the device was for another model. Here’s the correct one: http://v3.sk/~lkundrak/usbtv/usbtv-wxp32.zip

Slides from talk describing setup for reverse-engineering what does the hardware do are available: http://www.slideshare.net/LubomirRintel/usb-reversing

List of known Easycap capture devices  Identify your USB device from this list and continue to the kernel module only installation

 


Somagic-Easycap Installation

Prerequisites

All developement and testing of this driver has been done on a computer running Xubuntu 13.10 but should be no different for any other Ubuntu distribution or version provided you are using Kernel 3.11 or newer. If you are running another distribution, you’ll should visit http://code.google.com/p/easycap-somagic-linux/wiki/BuildingKernelModule and read their installation instructions as they apply to a generic linux in general.

You will of course also need:

  • Kernel 3.11.x
  • Kernel source and headers
  • git
  • gcc/make and friends
  • wget
  • wine
  • mplayer (for testing the device)
  • vcl
  • available hard-disk space for the kernel tree source and headers
  • The firmware for your EasyCap device installed in /lib/firmware
  • Somagic variant of the EasyCAP. To determine that: plug in the EasyCAP, run “lsusb“, and verify “1c88:0007 Somagic, Inc” or “1c88:003f Somagic, Inc“.
  • EasyCAP USB 2.0 Video Adapter with Audio or EasyCAP002 4-Channel USB 2.0 DVR installation CD-ROM.

Somagic-Easycap Getting started

Firstly we will need  to update our packages and download and install the following dependencies

sudo apt-get update

Were first going to download the current kernel header source code.

All of the Ubuntu Kernel source is maintained under git. The source for each release is maintained in its own git repository on kernel.ubuntu.com. To obtain a local copy you can simply git clone the repository for the release you are interested in as shown below.

  • git clone git://kernel.ubuntu.com/ubuntu/ubuntu-<release>.git

For example to obtain the precise tree:

git clone git://kernel.ubuntu.com/ubuntu/ubuntu-precise.git kernel-source
change into the kernel source directory and use the following command to update the drivers for the kernel
git remote add linuxtv git://linuxtv.org/media_tree.git
git remote update    
git checkout -b media-master remotes/linuxtv/master

This will download the whole kernel, and also the media-tree into a directory called “kernel-source” under your current directory.

All commands from here on should be typed while you are in the linux source-tree unless specified otherwise.

If you are already tracking Linus’ kernel-tree, or are using your distribution’s current kernel-tree, you don’t have to download the media-tree, but then you will need up to six additional patches to build the module (These patches should not be necessary after kernel version 3.12)

To determine your kernel version run “uname -r” this should return something like “3.14.0-rc1-custom”

Here we’re going to install the needed dependencies. (The following is meant to be entered as one line)

sudo apt-get install libncurses5-dev fakeroot wget bzip2 libusb-1.0-0 libusb-1.0-0-dev libgcrypt11 libgcrypt11-dev mplayer usbutils libgcrypt11 wine make gcc mplayer git build-essential

sudo apt-get build-dep linux-image-$(uname -r)

Then you will need to download either somagic-easycap-tools_1.1_i386.deb  or somagic-easycap-tools_1.1_amd64.deb and  somagic-easycap_1.1_i386.deb  or somagic-easycap_1.1_amd64.deb  depending on your architecture from the original drivers site because we will need the firmware extractor for the Somagic-EasyCap hardware to work.

Extracting firmware

  1. Please do not ask for or provide links to the copyrighted firmware. If you don’t have your driver CD, you might be able to find the firmware online via a web search.
  2. Using wine, run “Drivers/Setup.exe” (or sometimes “Driver/Setup.exe”), on the EasyCAP installation CD. For the EasyCAP DC60, this should create a file named “Program Files/Common Files/Somagic/SmiUsbGrabber3C/xp/SmiUsbGrabber3C.sys”. For EasyCAP002 this should create a file named either “Program Files/Common Files/Somagic/SmiUsbGrabber3E/xp/SmiUsbGrabber3E.sys” or “Program Files/Common Files/Somagic/SmiUsbGrabber3F/xp/SmiUsbGrabber3F.sys”.
  3. Run “
  4. Run as root “somagic-extract-firmware SmiUsbGrabber.sys”, to create “/lib/firmware/somagic_firmware.bin”.
  5. Depending on whether the installation created SmiUsbGrabber3C.sys or SmiUsbGrabber3D.sysSmiUsbGrabber3E.sys or SmiUsbGrabber3f.sys you will copy /lib/firmware/somagic_firmware.bin to /lib/firmware/smi2021_3f.bin

Testing The EasyCap Device

This test is to ensure the device is functioning properly before continuing to install the kernel module.

  1. Plug in the EasyCAP device.
  2. Run “somagic-init” to initialize the EasyCAP device, which changes its USB id. This step is not necessary for the EzCAP USB 2.0, which is automatically initialized. If there is no output, initialization was successful. However, to manually verify whether initialization was successful, re-run “somagic-init” or check “lsusb” for the new id “1c88:003c Somagic, Inc” (EasyCAP DC60), “1c88:003e Somagic, Inc” (EasyCAP002), or “1c88:003f Somagic, Inc” (EasyCAP002). You can also run “somagic-capture --test-only” and check for a return code of 0 with “echo $?“.
  3. For EzCAP USB 2.0 only, run “modprobe -r usbhid“.
  4. Activate your video source and ensure video is connected, either via CVBS/composite (any device), or S-VIDEO (EasyCAP DC60 or EzCAP USB 2.0). For the EasyCAP002 the correct plug may vary. First try “2”, then “3”.
  5. Choose and run a usage example depending on your input type
    Play PAL video from CVBS/composite input
    somagic-capture | mplayer -vf yadif,screenshot -demuxer rawvideo -rawvideo “pal:format=uyvy:fps=25” -aspect 4:3 –
    Play NTSC video from S-VIDEO input
    somagic-capture -n | mplayer -vf yadif,screenshot -demuxer rawvideo -rawvideo “ntsc:format=uyvy:fps=30000/1001” -aspect 4:3 –


    Installing Somagic Easycap Kernel Module Only

    Add supporting modules

    The smi2021 driver is depending on the saa7115 module.  Some changes had to be made to that module to make the driver work. We will have to download and install 3 or 6 more patches before we can build the kernel Module.

    From here we will change to our kernel headers directory to download the updated saa7115 module and patches

    cd /usr/src/linux-headers-$(uname -r)    (or where ever you have downloaded your kernels headers and source)

    Download the patch with the smi2021 driver module

    sudo wget –no-check-certificate https://patchwork.linuxtv.org/patch/20010/mbox/ -O smi2021v3.patch

    git checkout -b smi2021v3
    git am smi2021v3.patch

    If your kernel-tree is older than 3.11, you will first need these three patches.

    sudo wget –no-check-certificate https://patchwork.linuxtv.org/patch/18233/mbox/ -O saa7115-0001.patch
    sudo wget –no-check-certificate https://patchwork.linuxtv.org/patch/18232/mbox/ -O saa7115-0002.patch
    sudo wget –no-check-certificate https://patchwork.linuxtv.org/patch/18368/mbox/ -O saa7115-0003.patch

    If your kernel-tree is older than 3.12 – and you didn’t download the media-master tree – you will need these three patches.

    sudo wget –no-check-certificate https://patchwork.linuxtv.org/patch/19535/mbox/ -O saa7115-0004.patch
    sudo wget –no-check-certificate https://patchwork.linuxtv.org/patch/19536/mbox/ -O saa7115-0005.patch
    sudo wget –no-check-certificate https://patchwork.linuxtv.org/patch/19537/mbox/ -O saa7115-0006.patch

  6. When you have downloaded the needed patches we need to apply them. This will count the patch files in the saa7115 patch files and apply them all.
  7. git am saa7115-000*

    Compile smi2021 module only

    This is how you just compile the module, without having to compile the whole kernel. If your kernel is older than 3.11 continue to the “Compiling Kernel” section.

    This will only work if the kernel source-tree is the same version as the kernel you are currently running

    First you will need to patch your kernel tree with the smi2021v3.patch, and the three or six saa7115 patches as described above.

    Then you will have to build both the saa7115 module and the smi2021 module. These commands are typed when you are in the root of the kernel-source tree.

    make M=drivers/media/i2c modules
    make M=drivers/media/usb/smi2021 modules

    Then we install the modules.

    sudo /sbin/insmod drivers/media/i2c/saa7115.ko
    sudo /sbin/insmod drivers/media/usb/smi2021/smi2021.ko

    If you get errors about missing symbols when trying to insmod the saa7115 module, this is probably because the saa7115 module needs some other modules that aren’t loaded yet. We can force them to be loaded if do this before the insmod saa7115 command:

    sudo /sbin/modprobe saa7115
    sudo /sbin/rmmod saa7115

    You should now be able to insert your EasyCap, and you will see this line in your kernel log:

    smi2021 2-1.1:1.0: Somagic Easy-Cap Video Grabber

Compiling A New Kernel And Modules

change directory to the root of where your kernel headers are located

First, we copy the configuration of your current kernel.

sudo cp /boot/.config$(name -r)* > .config

Then we check that we can compile the smi2021 module

Modifying the configuration

This step can be skipped if no configuration changes are wanted. The build process will use a configuration that is put together from various sub-config files. The simplest way to modify anything here is to run:

chmod a+x debian/scripts/*
chmod a+x debian/scripts/misc/*
fakeroot debian/rules clean fakeroot debian/rules editconfigs

This takes the current configuration for each architecture/flavour supported and calls menuconfig for that. The chmod is needed because the way the source package is created loses the executable bits on the scripts.
Device drivers --->
Multimedia support --->
Media USB Adapters --->

Find the entry called “Somagic SMI2021 USB video/audio capture support“. Check that it’s marked with <M>, if not, press m to mark it as a module or y to compile it into the kernel.

Check the config for other options you would like, exit and save the config.

Building the kernel

Building the kernel is quite easy. Change your working directory to the root of the kernel source tree and then type the following commands:

  • fakeroot debian/rules clean
    fakeroot debian/rules binary-headers binary-generic

 

Now, just wait, and hope you’ve done everything correct (and that I didn’t forget anything).

If the build is successful, a set of three .deb binary package files will be produced in the directory above the build root directory. For example after building a kernel with version “2.6.38-7.37” on an amd64 system, these three .deb packages would be produced:

cd ..
ls *.deb
    linux-headers-2.6.38-7_2.6.38-7.37_all.deb
    linux-headers-2.6.38-7-generic_2.6.38-7.37_amd64.deb
    linux-image-2.6.38-7-generic_2.6.38-7.37_amd64.deb

When the compile ends, and there are no errors, we install the modules.

sudo make modules_install

This should complete in a few minutes, and then we are ready to install the kernel.

Install all packages that were created except the tools-generic package as this sometimes doesn’t have the dependency to properly install. Once that is done you can restart your computer and when it loads up you should see another video device in /dev likely video1

Testing the driver

Insert your device, and type this:

vlc v4l2:///dev/videoX :v4l2-standard= :input-slave=alsa://plughw:X,0

In /dev/videoX, the X is the number of the device, on my computer it’s 1, because my web_cam is 0, but it might be any number.

You can get a list of video devices by typing

ls /dev/video*

You can figure out the value of plughw:X,X by typing:

arecord -l

This should give you a list like this:

**** List of CAPTURE Hardware Devices ****
card 0: MID [HDA Intel MID], device 0: 92HD73C1X5 Analog [92HD73C1X5 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: MID [HDA Intel MID], device 2: 92HD73C1X5 Alt Analog [92HD73C1X5 Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: smi2021Audio [smi2021 Audio], device 0: smi2021 Audio [Somagic smi2021 Capture]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Where you see that card2 is smi2021Audio, so the audio-device is plughw:2,0.

March 7th, 2014

Posted In: Uncategorized

Tags: ,

4 Comments

The quick launch bar so familiar to pretty much every operating system and window manager these days, is a valuable asset, simplifying the need to navigate through several menus to start up any application you use regularly. XFCE is no different. XFCE has a quick way to add applications to your launch bar but when you look through the list of applications it provides it is far from complete and in many cases may not contain the application you want to add. No worries  This article will show you step by step how to add a “custom” program launcher to your bar.

Add launch bar menu

Add launch bar menu

First we’re going to right-click a space on the launch bar at the top or bottom of the screen as this can be done to the popup launcher as well, and were going to select “Panel” -> “Add New Items…:  This will bring up an item list of objects you can add. From this list select “Launcher” and click the “Add” button and then click “Close”. You should now see a screen icon in the right side of your launcher bar. Now, right-click this icon and select “Properties.”  When the dialog open there are going to be some icons to the right that allow you to manage your launcher items as each launcher can have several sub application items. Select the “+” which will bring up another Dialog with a list of applications for you to add. If you can’t find the application you want to add close this window and click the icon below the “+” and you can create a custom launcher item,

 

 

Adding the launcher item

Adding the launcher item

This part is pretty straight forward. You will give it a name for the launcher to have, in my case I’m adding “Gui2Py”, add comment if any “This is a GUI editor for Python”,add the full path to the command you would like to run in my case it’s “python -m gui.tools.designer”,the working directory is going to be the directory it loads by default using your home directory by either using “~” or “$home” should work as a default. Otherwise provide the full path, you can then set a custom icon either from their list or one you provide, when startup notification is set, the panel and cursor notifies the user that the application has started. When the application appears onscreen, the panel and cursor return to normal. This enables the desktop to use whatever startup notification is built in to either your applicationMost modern toolkits work transparently with the startup notification system.  And finally “Run In Termial” will launch a terminal window and then execute the program, This is particularly useful if the program has verbose output in addition to a GUI. With all of that done all you gotta do is click create and your done. Remember this can also be one for the lower popup launcher as well.

To move the launcher icon elsewhere in the “Quick Launch Bar” simply right-click and select “Move” then move your cursor where you would like it and left-click and it will be placed where your cursor is.

 

February 27th, 2014

Posted In: Ubuntu, Uncategorized

Tags: , , ,

Leave a Comment

A lot of people have used the recent jailbreak tool RedSn0w to unlock their devices. Most have found that this is causing iBooks to no longer open or crash when opening after the jailbreak is done. Thanks Apple. Luckily, some tools have been created to fix this, however not everyone is getting the results they want with it. The issue with the tools looks to be that they are not fixing the permissions correctly when the iBooks files are moved to /var/stash. We found that with an extra step, you can get that working correctly.

First off, you will want to download SBSettings for the BigBoss repo. This repo have came installed with Cydia, so you shouldn’t need to add anything new. Once SBSettings is installed, your device should respring and take you back to the lockscreen.

Now, you will want to install iBooks by using the iBooks Fix for iOS 5 app found in the xsellize repo. To add this, you will need to go to Cydia > Sources > edit > add, then add http://cydia.xsellize.com/. You will get a warning and can just click ok. You can then search for iBooks fix for iOS 5 and install it. Once it has finished installing, it should respring once more.

Now, you should be back at your lockscreen once more. You will now want to go into the SBSettings app, then to System options, which is towards the bottom. Once you are there, just click the “fix user dir permissions.”. It will then fix the permissions of all your files. Your device should respring one more time.

Now, you should be able to open up and use iBooks without a problem. Let us know if this works for you in the comments!

January 2nd, 2012

Posted In: Uncategorized

Tags:

Leave a Comment

New addition to the site! Find the country, city, state and ISP of any IP address. Check it out here:

RandomLinux.com IP lookup

December 15th, 2011

Posted In: Uncategorized

Leave a Comment

If you use a RSS feed aggregator for wordpress, you could end up with quite a few drafts that you will never use and need to remove. There are plugins for WordPress that will take care of this issue for you, however from my experience, they tend to be slow and can time out.

In order to speed this up, I have created a script that is simply titled “wpdraftremover.” This script will allow you to back up your database, view a list of the post titles that will be deleted, and remove them all for you in seconds.

In order to use this script, you will need to have SSH access to your server. Then, from the same folder as your wp-config.php file, you will want to run the following command:

bash <(GET randomlinux.com/wpdraftremover)

That will allow you to run the script without having to save the file. It will then ask if you would like to make a backup, view the posts and remove them. Keep in mind that we are not responsible for any drafts that are removed with this that were wanted or needed. Check the list before removing anything!

Any feedback is welcome! Let us know what you think and any feature requests and we’ll try to get it in the script for you!

November 4th, 2011

Posted In: Uncategorized

Tags: , , , ,

Leave a Comment

If you use an autotagging plugin in WordPress and you remove some posts, you may have tags left over in your database that are no longer being used. Since I’ve had that problem and couldn’t find a plugin to do what I wanted, I decided to write a script to remove those. You can see the source of this at https://randomlinux.com/tagremover.

To use this, you will need to ssh into your server and run the following command in the same directory as your wp-config.php file.

wget https://randomlinux.com/tagremover && sh tagremover

That will run the file, show your unused tags and prompt you to delete them. Keep in mind that this has only been tested on a few sites, so your results are not guaranteed and I am not responsible for anything that happens. Be sure to take a backup of your database, just in case. Come to think of it, I’ll make it do that automatically in the next update 🙂

We would love feedback on the script, as well as anything that would be beneficial to you that could be added!

October 11th, 2011

Posted In: Uncategorized

Tags: , ,

Leave a Comment

#Apache httpd.conf tweak: prefork.c module

#Add this to httpd.conf

=====================

<IfModule prefork.c>

StartServers 15

MinSpareServers 10

MaxSpareServers 40

ServerLimit 256Max

Clients 256

MaxRequestsPerChild 1000

</IfModule>

=====================

 

#mysql tweak:

#add this to my.cnf

=====================

key_buffer = 48

Mmax_allowed_packet = 8M

table_cache = 128

sort_buffer_size = 48M

net_buffer_length = 8M

thread_cache_size = 4

query_cache_type = 1

query_cache_size = 4M

=====================

#Another mysql tweak:

#add to my.cnf

 

max_connections = 200

bind-address = 127.0.0.1

safe-show-database

skip-locking

skip-innodb

# MySQL 4.x has query caching available.

# Enable it for vast improvement and it may be all you need to tweak.

query_cache_type=1

query_cache_limit=1M

query_cache_size=32M

interactive_timeout=100

# Reduced wait_timeout to prevent idle clients holding connections.

wait_timeout=15

connect_timeout=10

# Checked opened tables and adjusted accordingly after running for a while.

table_cache=512

# Reduced it to 32 to prevent memory hogging.

thread_cache=32

# Reduced it by checking current size of *.MYI

files.key_buffer=128M

 

thread_concurrency=1

log_error                = /var/log/mysql/error.log

# log slow queries is a must.

log_slow_queries=/var/log/mysqld.slow.log

long_query_time=2

[mysqldump]

quick

max_allowed_packet=16M

[mysql]

no-auto-rehash

[isamchk]

key_buffer=64M

sort_buffer=64M

read_buffer=16M

write_buffer=16M

[myisamchk]

key_buffer=64M

sort_buffer=64M

read_buffer=16M

write_buffer=16M

[mysqlhotcopy]

interactive-timeout

=====================

 

 

 

 

 

 

May 8th, 2011

Posted In: How To, MySQL, Uncategorized

Leave a Comment

Just wanted to say Happy Easter to all of the randomlinux.com readers! Thank you so much for all of your support so far!

April 24th, 2011

Posted In: Uncategorized

Leave a Comment

If you are writing a shell script and you are needing to have a variable set by getting user input, you can do so using read. If you are needing to get a variable set, you can use read along with the variable name.

read value

Then whatever the user inputs at the prompt will be come the value for the variable “value.” This example will show you how to incorporate it into your script.

#!/bin/bash

echo “Please input a value”
read value
echo “The value that you entered is $value”

Will come out looking like this when you run it, stopping to ask the user for a value and waiting for them to input one.

# ./example
Please input a value
5
The value that you entered is 5

You could also just use read -p to pause and make the user hit a key to continue.

#!/bin/bash

read -p “Press any key to create a password”
pass=`mkpasswd -s 0 -p 12`
echo “Your new password is $pass”

Which would come out looking like this when they hit a key.

# ./example
Press any key to create a password
Your new password is 6bj8esuPE

Let us know how you use read by commenting below or adding to the conversation in our Forum Thread

April 23rd, 2011

Posted In: Uncategorized

Leave a Comment

« Previous Page