Search Results

Search found 30 results on 2 pages for 'updatedb'.

Page 1/2 | 1 2  | Next Page >

  • updatedb & locate command problem - Files from external hard drive are no longer indexed after rebooting

    - by user784637
    Files from my external hard drive are no longer indexed after rebooting. I have to remount and then run # updatedb after each reboot. The problem is updatedb takes a few minutes for my external hard drives. Is there any way I can retain indexing for my externals after I reboot so that the locate command can search through my externals? EDIT: Per Request here are my specs: $ cat /etc/updatedb.conf PRUNE_BIND_MOUNTS="yes" # PRUNENAMES=".git .bzr .hg .svn" PRUNEPATHS="/tmp /var/spool /media" PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre_lite tmpfs usbfs udf fuse.glusterfs fuse.sshfs ecryptfs fusesmb devtmpfs" # mount /dev/sda5 on / type ext4 (rw,errors=remount-ro) proc on /proc type proc (rw,noexec,nosuid,nodev) none on /sys type sysfs (rw,noexec,nosuid,nodev) none on /sys/fs/fuse/connections type fusectl (rw) none on /sys/kernel/debug type debugfs (rw) none on /sys/kernel/security type securityfs (rw) none on /dev type devtmpfs (rw,mode=0755) none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) none on /dev/shm type tmpfs (rw,nosuid,nodev) none on /var/run type tmpfs (rw,nosuid,mode=0755) none on /var/lock type tmpfs (rw,noexec,nosuid,nodev) none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev) gvfs-fuse-daemon on /home/me/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=me) /dev/sdb1 on /media/me type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions) /dev/sdd1 on /media/Little Boy type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions) /dev/sde1 on /media/Fat Man type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions) # on_ac_power; echo $? 255

    Read the article

  • how to use updatedb command as an ordinary user on linux?

    - by hugemeow
    locate command is very useful tool on linux, but it seems only root can run updatedb command, so it will be very unconvinent to use locate command on linux, so how to make ordinary user to have the priviledge to run updatedb command? updatedb is the command use to update the db used by locate command:) error message when try to run updatedb using ordinary user: [mirror@home code]$ updatedb updatedb: can not open a temporary file for `/var/lib/mlocate/mlocate.db'

    Read the article

  • How can I view updatedb database content, and then exclude certain files/paths?

    - by rubo77
    The updatedb database on my debian server is quite slow. where is the database located and how can I view its content and find out if there are some paths with useless stuff, that I could add to the prunepaths? my /etc/updatedb.conf looks like this: ... # filesystems which are pruned from updatedb database PRUNEFS="NFS nfs nfs4 afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre_lite tmpfs usbfs udf" export PRUNEFS # paths which are pruned from updatedb database PRUNEPATHS="/tmp /usr/tmp /var/tmp /afs /amd /alex /var/spool /sfs /media /var/backups/rsnapshot /var/mod_pagespeed/" ... and how can I prune all paths that contain */.git/* and */.svn/* ?

    Read the article

  • How do you get autofs and updatedb to work together?

    - by Veek.M
    /etc/my.misc sda1 -fstype=ntfs,user,exec :/dev/sda1 sda3 -fstype=ntfs,user,exec :/dev/sda3 sda4 -fstype=ntfs,user,exec :/dev/sda4 /etc/auto.master /my /etc/my.misc --ghost When I run locate .pdf, I get nothing because though the mount points (sda1, sda2, ..) are created in /my - there's nothing in them till I access them. Unfortunately this is not good enough for updatedb and it purges its cache of /my/sdaX files. How do I prevent/solve this problem?

    Read the article

  • ionice idle is ignored

    - by Ferran Basora
    I have been testing the ionice command for a while and the idle (3) mode seems to be ignored in most cases. My test is to run both command at the same time: du <big folder> ionice -c 3 du <another big folder> If I check both process in iotop I see no difference in the percentage of io utilization for each process. To provide more information about the CFQ scheduler I'm using a 3.5.0 linux kernel. I started doing this test because I'm experimenting a system lag each time a daily cron job updatedb.mlocate is executed in my Ubuntu 12.10 machine. If you check the /etc/cron.daily/mlocate file you realize that the command is executed like: /usr/bin/ionice -c3 /usr/bin/updatedb.mlocate Also, the funny thing is that whenever my system for some reason starts using swap memory, the updatedb.mlocate io process is been scheduled faster than kswapd0 process, and then my system gets stuck. Some suggestion? References: http://ubuntuforums.org/showthread.php?t=1243951&page=2 https://bugs.launchpad.net/ubuntu/+source/findutils/+bug/332790

    Read the article

  • Why 'nobody' always starts a new `find` program that always consume my memory?

    - by UniMouS
    $ ps -elf | grep ... 0 D nobody 27320 27319 2 90 10 - 353471 sleep_ 07:54 ? 00:02:19 /usr/bin/find / -ignore_readdir_race ( -fstype NFS -o -fstype nfs -o -fstype nfs4 -o -fstype afs -o -fstype binfmt_misc -o -fstype proc -o -fstype smbfs -o -fstype autofs -o -fstype iso9660 -o -fstype ncpfs -o -fstype coda -o -fstype devpts -o -fstype ftpfs -o -fstype devfs -o -fstype mfs -o -fstype shfs -o -fstype sysfs -o -fstype cifs -o -fstype lustre_lite -o -fstype tmpfs -o -fstype usbfs -o -fstype udf -o -fstype ocfs2 -o -type d -regex \(^/tmp$\)\|\(^/usr/tmp$\)\|\(^/var/tmp$\)\|\(^/afs$\)\|\(^/amd$\)\|\(^/alex$\)\|\(^/var/spool$\)\|\(^/sfs$\)\|\(^/media$\)\|\(^/var/lib/schroot/mount$\) ) -prune -o -print0 ... This job always start automatically and consumes my memory. Even after I kill it, it will starts several hours later. What's that job? EDIT Note: the pid is different from the above because I killed the above one, wait for several hours, then the second one comes. $ pstree -psl |-anacron(25920)---sh(25929)---run-parts(25930)---locate(26343)---updatedb.findut(26348)-+-frcode(26358) | |-sort(26357) | `-updatedb.findut(26356)---su(26387)---sh(26402)---find(26403) This is what it look like in a graphical tool:

    Read the article

  • ext4 filesystem corruption -- maybe hardware error?

    - by pts
    I'm getting these errors in dmesg after about half an hour after I turn on the computer: [ 1355.677957] EXT4-fs error (device sda2): htree_dirblock_to_tree: inode #1318420: (comm updatedb.mlocat) bad entry in directory: directory entry across blocks - block=5251700offset=0(0), inode=1802725748, rec_len=179136, name_len=32 [ 1355.677973] Aborting journal on device sda2-8. [ 1355.678101] EXT4-fs (sda2): Remounting filesystem read-only [ 1355.690144] EXT4-fs error (device sda2): htree_dirblock_to_tree: inode #1318416: (comm updatedb.mlocat) bad entry in directory: directory entry across blocks - block=5251699offset=0(0), inode=2194783952, rec_len=53280, name_len=152 [ 1356.864720] EXT4-fs error (device sda2): htree_dirblock_to_tree: inode #1312795: (comm updatedb.mlocat) bad entry in directory: directory entry across blocks - block=5251176offset=1460(13748), inode=1432317541, rec_len=208208, name_len=119 /dev/sda is an SSD, and it's using the noop scheduler. /etc/fstab entry: UUID=acb4eefa-48ff-4ee1-bb5f-2dccce7d011f / ext4 errors=remount-ro,noatime,discard,user_xattr 0 1 System information: $ cat /proc/mounts | grep /dev/sd /dev/sda1 /boot ext2 rw,noatime,errors=continue 0 0 $ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=10.04 DISTRIB_CODENAME=lucid DISTRIB_DESCRIPTION="Ubuntu 10.04.3 LTS" $ uname -a Linux leetpad 2.6.35-30-generic-pae #61~lucid1-Ubuntu SMP Thu Oct 13 21:14:29 UTC 2011 i686 GNU/Linux I've run memtest for 7 hours, it didn't found any memory errors. Any obvious ideas what can go wrong in this case? The most reasonable thing I can imagine is that the SSD is silently dropping some write requests, which eventually leads to an EXT4 filesystem inconsistency (but no disk I/O errors). How can this happen? Is there a relevant configuration option I should ensure to be set correctly? What tools should I use to diagnose the hardware failures? Would it be possible to diagnose the SSD failure without overwriting data?

    Read the article

  • how to find which package certain command belongs to on centos?

    - by hugemeow
    for example i can easily find locate command belongs to mlocate.i386 package. yum search locate mlocate.i386 : An utility for finding files by name [mirror@home /]$ rpm -qa | grep locate mlocate-0.15-1.el5.1 yum search updatedb Loaded plugins: fastestmirror, protectbase 0 packages excluded due to repository protections =========================================== Matched: updatedb =========================================== mlocate.i386 : An utility for finding files by name but it's not so easy to find which package free command belongs to: yum search free // this command just returns too much informationy rpm -qa | grep free freetype-2.2.1-31.el5_8.1 // obviously not the package by which free command is installed so is there any convinent way to know which package a specific command belongs to on linux? for example centos or some other distributions:)

    Read the article

  • More interruptions than cpu context switches

    - by Christopher Valles
    I have a machine running Debian GNU/Linux 5.0.8 (lenny) 8 cores and 12Gb of RAM. We have one core permanently around 40% ~ 60% wait time and trying to spot what is happening I realized that we have more interruptions than cpu context switches. I found that the normal ratio between context switch and interruptions is around 10x more context switching than interruptions but on my server the values are completely different. backend1:~# vmstat -s 12330788 K total memory 12221676 K used memory 3668624 K active memory 6121724 K inactive memory 109112 K free memory 3929400 K buffer memory 4095536 K swap cache 4194296 K total swap 7988 K used swap 4186308 K free swap 44547459 non-nice user cpu ticks 702408 nice user cpu ticks 13346333 system cpu ticks 1607583668 idle cpu ticks 374043393 IO-wait cpu ticks 4144149 IRQ cpu ticks 3994255 softirq cpu ticks 0 stolen cpu ticks 4445557114 pages paged in 2910596714 pages paged out 128642 pages swapped in 267400 pages swapped out 3519307319 interrupts 2464686911 CPU context switches 1306744317 boot time 11555115 forks Any ideas if that is an issue? And in that case, how can I spot the cause and fix it? Update Following the instructions of the comments and focusing on the core stuck in wait I checked the processes attached to that core and below you can find the list: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ P COMMAND 24 root RT -5 0 0 0 S 0 0.0 0:03.42 7 migration/7 25 root 15 -5 0 0 0 S 0 0.0 0:04.78 7 ksoftirqd/7 26 root RT -5 0 0 0 S 0 0.0 0:00.00 7 watchdog/7 34 root 15 -5 0 0 0 S 0 0.0 1:18.90 7 events/7 83 root 15 -5 0 0 0 S 0 0.0 1:10.68 7 kblockd/7 291 root 15 -5 0 0 0 S 0 0.0 0:00.00 7 aio/7 569 root 15 -5 0 0 0 S 0 0.0 0:00.00 7 ata/7 1545 root 15 -5 0 0 0 S 0 0.0 0:00.00 7 ksnapd 1644 root 15 -5 0 0 0 S 0 0.0 0:36.73 7 kjournald 1725 root 16 -4 16940 1152 488 S 0 0.0 0:00.00 7 udevd 2342 root 20 0 8828 1140 956 S 0 0.0 0:00.00 7 sh 2375 root 20 0 8848 1220 1016 S 0 0.0 0:00.00 7 locate 2421 root 30 10 8896 1268 1016 S 0 0.0 0:00.00 7 updatedb.findut 2430 root 30 10 58272 49m 616 S 0 0.4 0:17.44 7 sort 2431 root 30 10 3792 448 360 S 0 0.0 0:00.00 7 frcode 2682 root 15 -5 0 0 0 S 0 0.0 3:25.98 7 kjournald 2683 root 15 -5 0 0 0 S 0 0.0 0:00.64 7 kjournald 2687 root 15 -5 0 0 0 S 0 0.0 1:31.30 7 kjournald 3261 root 15 -5 0 0 0 S 0 0.0 2:30.56 7 kondemand/7 3364 root 20 0 3796 596 476 S 0 0.0 0:00.00 7 acpid 3575 root 20 0 8828 1140 956 S 0 0.0 0:00.00 7 sh 3597 root 20 0 8848 1216 1016 S 0 0.0 0:00.00 7 locate 3603 root 30 10 8896 1268 1016 S 0 0.0 0:00.00 7 updatedb.findut 3612 root 30 10 58272 49m 616 S 0 0.4 0:27.04 7 sort 3655 root 20 0 11056 2852 516 S 0 0.0 5:36.46 7 redis-server 3706 root 20 0 19832 1056 816 S 0 0.0 0:01.64 7 cron 3746 root 20 0 3796 580 484 S 0 0.0 0:00.00 7 getty 3748 root 20 0 3796 580 484 S 0 0.0 0:00.00 7 getty 7674 root 20 0 28376 1000 736 S 0 0.0 0:00.00 7 cron 7675 root 20 0 8828 1140 956 S 0 0.0 0:00.00 7 sh 7708 root 30 10 58272 49m 616 S 0 0.4 0:03.36 7 sort 22049 root 20 0 8828 1136 956 S 0 0.0 0:00.00 7 sh 22095 root 20 0 8848 1220 1016 S 0 0.0 0:00.00 7 locate 22099 root 30 10 8896 1264 1016 S 0 0.0 0:00.00 7 updatedb.findut 22108 root 30 10 58272 49m 616 S 0 0.4 0:44.55 7 sort 22109 root 30 10 3792 452 360 S 0 0.0 0:00.00 7 frcode 26927 root 20 0 8828 1140 956 S 0 0.0 0:00.00 7 sh 26947 root 20 0 8848 1216 1016 S 0 0.0 0:00.00 7 locate 26951 root 30 10 8896 1268 1016 S 0 0.0 0:00.00 7 updatedb.findut 26960 root 30 10 58272 49m 616 S 0 0.4 0:10.24 7 sort 26961 root 30 10 3792 452 360 S 0 0.0 0:00.00 7 frcode 27952 root 20 0 65948 3028 2400 S 0 0.0 0:00.00 7 sshd 30731 root 20 0 0 0 0 S 0 0.0 0:01.34 7 pdflush 31204 root 20 0 0 0 0 S 0 0.0 0:00.24 7 pdflush 21857 deploy 20 0 1227m 2240 868 S 0 0.0 2:44.22 7 nginx 21858 deploy 20 0 1228m 2784 868 S 0 0.0 2:42.45 7 nginx 21862 deploy 20 0 1228m 2732 868 S 0 0.0 2:43.90 7 nginx 21869 deploy 20 0 1228m 2840 868 S 0 0.0 2:44.14 7 nginx 27994 deploy 20 0 19372 2216 1380 S 0 0.0 0:00.00 7 bash 28493 deploy 20 0 331m 32m 16m S 4 0.3 0:00.40 7 apache2 21856 deploy 20 0 1228m 2844 868 S 0 0.0 2:43.64 7 nginx 3622 nobody 30 10 21156 10m 916 D 0 0.1 4:42.31 7 find 7716 nobody 30 10 12268 1280 888 D 0 0.0 0:43.50 7 find 22116 nobody 30 10 12612 1696 916 D 0 0.0 6:32.26 7 find 26968 nobody 30 10 12268 1284 888 D 0 0.0 1:56.92 7 find Update As suggested I take a look at /proc/interrupts and below the info there: CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7 0: 35 0 0 1469085485 0 0 0 0 IO-APIC-edge timer 1: 0 0 0 8 0 0 0 0 IO-APIC-edge i8042 8: 0 0 0 1 0 0 0 0 IO-APIC-edge rtc0 9: 0 0 0 0 0 0 0 0 IO-APIC-fasteoi acpi 12: 0 0 0 105 0 0 0 0 IO-APIC-edge i8042 16: 0 0 0 0 0 0 0 580212114 IO-APIC-fasteoi 3w-9xxx, uhci_hcd:usb1 18: 0 0 142 0 0 0 0 0 IO-APIC-fasteoi uhci_hcd:usb6, ehci_hcd:usb7 19: 9 0 0 0 0 0 0 0 IO-APIC-fasteoi uhci_hcd:usb3, uhci_hcd:usb5 21: 0 0 0 0 0 0 0 0 IO-APIC-fasteoi uhci_hcd:usb2 23: 0 0 0 0 0 0 0 0 IO-APIC-fasteoi uhci_hcd:usb4, ehci_hcd:usb8 1273: 0 0 1600400502 0 0 0 0 0 PCI-MSI-edge eth0 1274: 0 0 0 0 0 0 0 0 PCI-MSI-edge ahci NMI: 0 0 0 0 0 0 0 0 Non-maskable interrupts LOC: 214252181 69439018 317298553 21943690 72562482 56448835 137923978 407514738 Local timer interrupts RES: 27516446 16935944 26430972 44957009 24935543 19881887 57746906 24298747 Rescheduling interrupts CAL: 10655 10705 10685 10567 10689 10669 10667 396 function call interrupts TLB: 529548 462587 801138 596193 922202 747313 2027966 946594 TLB shootdowns TRM: 0 0 0 0 0 0 0 0 Thermal event interrupts THR: 0 0 0 0 0 0 0 0 Threshold APIC interrupts SPU: 0 0 0 0 0 0 0 0 Spurious interrupts ERR: 0 All the values seems more or less the same for all the cores but this one IO-APIC-fasteoi 3w-9xxx, uhci_hcd:usb1 only affects to the core 7 (the same with the wait time of 40% ~ 60%) could be something attached to the usb port causing the issue? Thanks in advanced

    Read the article

  • How do I reduce the size of mlocate database?

    - by MountainX
    I'm out of space on /var 25G 25G 0 100% /var It looks like mlocate.db is the problem: # find . -printf '%s %p\n' | sort -nr | head 13140140032 ./lib/mlocate/mlocate.db.cgLMAM 12409839616 ./lib/mlocate/mlocate.db.MqGeqe cat /etc/updatedb.conf PRUNE_BIND_MOUNTS="yes" PRUNENAMES=".git .bzr .hg .svn" PRUNEPATHS="/tmp /var/spool /media" PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre_lite tmpfs usbfs udf" I don't see anything else to prune. So how can I fix this? Thanks

    Read the article

  • Unable to install flash plugin in Ubuntu 12.04

    - by Farhat
    Yesterday I upgraded from Ubuntu 11.10 to Ubuntu 12.04 (64 bit). The upgrade went smoothly (far more than I expected). Unfortunately, I cannot seem to install the flash plugin in either Firefox or Chrome. chrome://plugins does not show flash. I tried 19:17farhat ~$ sudo apt-get install flashplugin-installer Reading package lists... Done Building dependency tree Reading state information... Done flashplugin-installer is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Yet, I cannot seem to find anything related to flash on the system. 19:17farhat ~$ sudo updatedb [sudo] password for farhat: 19:17farhat ~$ locate libflashplayer.so 19:17farhat ~$ locate libflashplayer 19:17farhat ~$ locate libflash /usr/lib/libreoffice/program/libflashlo.so 19:17farhat ~$ I am at the end of everything I know. Any help will be appreciated. I have tried removing and reinstalling the package. Still the same results.

    Read the article

  • Indexing File Contents

    - by Rafid K. Abdullah
    People seem to have already asked about indexing file system: What options are there for indexing my filesystem? Alternatives to OS X's Spotlight? but I want to actually just index a certain working directory and be able to do that manually (so that I make sure my search is correct). Basically, I am on working a project and I need be able to search in contents quickly. I already use 'locate' and 'updatedb' commands, but those search for file names only. I am looking for similar commands but file contents. Just in case you are wondering why I don't use tracker also like answered in the two posts, tracker have a set of prespecified folders to search in them, and whenever you make a search, you search in all of them. What I want is to be able to search in every project separately.

    Read the article

  • Finding files at more speed

    - by Chaitanya
    I have been using find command to find files on my 1 tb hard disk. it takes very long. then I used locate which proved to be faster with regular update using updatedb. But the limitation of locate is that I cannot find files with certain size or modified/created time. can you suggest me any ideas on how to find files at more speed or in that case how to pipe output of locate command in a way that all other information like size, time, etc. can be displayed or redirected to a file.

    Read the article

  • How can I find files quicker than find or locate?

    - by Chaitanya
    I have been using find command to find files on my 1 tb hard disk. it takes very long. then I used locate which proved to be faster with regular update using updatedb. But the limitation of locate is that I cannot find files with certain size or modified/created time. can you suggest me any ideas on how to find files at more speed or in that case how to pipe output of locate command in a way that all other information like size, time, etc. can be displayed or redirected to a file.

    Read the article

  • Robustly disabling specific cron.{hourly,daily,weekly} script

    - by benizi
    On various systems that I administer, there are cron scripts that get run via the commonly-used /etc/cron.{hourly,daily,weekly} layout. What I want to know is whether there's any common 'disable this script' functionality. Obviously, simply deleting something out of a given directory will disable it, but I'm looking for a more permanent solution. Deleting /etc/cron.daily/slocate will work to disable the nightly updatedb on my home machine (where I never use slocate), but next time I upgrade the slocate package, I'm pretty sure it'll reappear. The two distributions I'm most interested in are Gentoo and OpenSUSE, but I'm hoping there's a widely-implemented mechanism. Both distros as I have them use vixie-cron (not sure it matters).

    Read the article

  • chromium-browser usus 99,99% IO disk

    - by lars
    My favorite browser: chromium is testing my patience. For some reason it sometimes uses 99,99% of I/O. (reading 2-3MB/s) Other processes (updatedb.mlocate, [kswapd0], clementine, compiz) show the same behavior. However this problem always starts and ends with chromium. To illustrate the impact on my system: when my disk starts to spin like crazy en the led burns continiously the system is so slow that it takes about two to five minuits to switch to tty6, log in and execute "killall chromiumbrowser && killall chromium" This is way faster than starting a new terminal in X, just starting a terminal seems to heavy for compiz under these circumstances. Waiting until its over takes more than 30 minuits, if it ends at all. The exact circumstances are difficult to replicate. Several tabs have to be open, usualy 8 or more. It seems that the chance to increases when more complex sites like gmail of plugins like flash are running. Opening several new tabs at omgubunt.co.uk has the best chance to replecate this isue. I have no idea where to start looking for a solution. Any help would be greatly apreciated ubuntu 12.10 | 2GB | 2x 1.66GHz Intel | 32bit | IBM Thinkpad R60e

    Read the article

  • PostGIS - can't create spatially-enabled database

    - by itgorilla
    I'm using Ubuntu 10.10, PostgreSQL 9.0 and PostGIS 1.5. I've installed PostGIS 1.5 from: https://launchpad.net/~ubuntugis/+archive/ubuntugis-unstable I used PPA first then the command: sudo apt-get install postgis to install postgis. I've been following these instructions to create a spatially-enabled database: http://ostgis.refractions.net/docs/ch02.html#id2630100 I got to the point where it's saying: Now load the PostGIS object and function definitions into your database by loading the postgis.sql definitions file (located in [prefix]/share/contrib as specified during the configuration step). psql -d [yourdatabase] -f postgis.sql Well, there is no postgis.sql on my server after the installation. I did an sudo updatedb to make sure I can find postgis.sql but it's not there. Any ideas? Thank you!

    Read the article

  • Does a C# using statement perform try/finally?

    - by Lirik
    Suppose that I have the following code: private void UpdateDB(QuoteDataSet dataSet, Strint tableName) { using(SQLiteConnection conn = new SQLiteConnection(_connectionString)) { conn.Open(); using (SQLiteTransaction transaction = conn.BeginTransaction()) { using (SQLiteCommand cmd = new SQLiteCommand("SELECT * FROM " + tableName, conn)) { using (SQLiteDataAdapter sqliteAdapter = new SQLiteDataAdapter()) { sqliteAdapter.Update(dataSet, tableName); } } transaction.Commit(); } } } The C# documentation states that with a using statement the object within the scope will be disposed and I've seen several places where it's suggested that we don't need to use try/finally clause. I usually surround my connections with a try/finally, and I always close the connection in the finally clause. Given the above code, is it reasonable to assume that the connection will be closed if there is an exception?

    Read the article

  • How to pass jQuery variable with AJAX to PHP page

    - by Walden
    Trying to pass the variable "flickrurl" to a PHP page with jQuery/ajax. It works when using a plain text string and not the variable. Am I assigning the variable properly? see the full code in action here: http://is.gd/c9ytI $trash.droppable({ accept: '#gallery > li', activeClass: 'ui-state-highlight', drop: function(ev, ui) { deleteImage(ui.draggable); //set variable equal to src of image tag in #gallery > li var $flickrurl = $item.find('img').attr("src"); //pass variable to php page $.post("updateDB.php", $flickrurl ); } });

    Read the article

  • Ubuntu Preseed set Norwegian Keyboard?

    - by Vangelis Tasoulas
    It's been a couple of days now that I am trying to make a fully automated unattended installation. I managed to make it work with Ubuntu/Cobbler and a preseed file, but I cannot set the correct keyboard layout which is Norwegian in this case. I am doing the tests on a virtual machine and when I am going with a normal manual installation (no preseed) everything is working fine. When I am using the preseed file, I always end up with an "English (US)" keyboard no matter the many different options I have tried. I can change it manually with the "dpkg-reconfigure keyboard-configuration" command, but that's not the case. It should be handled automatically using the preseed file. I am using DEBCONF_DEBUG=5 when the grub is loading, and as I see in "/var/log/installer/syslog" file after the installation has finished, the preseeding commands are accepted. Can anyone help on this? The preseed file I am using is following: d-i debian-installer/country string NO d-i debian-installer/language string en_US:en d-i debian-installer/locale string en_US.UTF-8 d-i console-setup/ask_detect boolean false d-i keyboard-configuration/layout select Norwegian d-i keyboard-configuration/variant select Norwegian d-i keyboard-configuration/modelcode string pc105 d-i keyboard-configuration/layoutcode string no d-i keyboard-configuration/xkb-keymap select no d-i netcfg/choose_interface select auto d-i netcfg/get_hostname string myhostname d-i netcfg/get_domain string simula.no d-i hw-detect/load_firmware boolean true d-i mirror/country string manual d-i mirror/http/hostname string ftp.uninett.no d-i mirror/http/directory string /ubuntu d-i mirror/http/proxy string http://10.0.1.253:3142/ d-i mirror/codename string precise d-i mirror/suite string precise d-i clock-setup/utc boolean true d-i time/zone string Europe/Oslo d-i clock-setup/ntp boolean true d-i clock-setup/ntp-server string 10.0.1.254 d-i partman-auto/method string lvm partman-auto-lvm partman-auto-lvm/new_vg_name string vg0 d-i partman-auto/purge_lvm_from_device boolean true d-i partman-lvm/device_remove_lvm boolean true d-i partman-md/device_remove_md boolean true d-i partman-lvm/confirm boolean true d-i partman-lvm/confirm_nooverwrite boolean true d-i partman-auto-lvm/guided_size string max d-i partman-auto/choose_recipe select 30atomic d-i partman/default_filesystem string ext4 d-i partman-partitioning/confirm_write_new_label boolean true d-i partman/choose_partition select finish d-i partman/confirm boolean true d-i partman/confirm_nooverwrite boolean true d-i partman/mount_style select uuid d-i passwd/root-login boolean false d-i passwd/make-user boolean true d-i passwd/user-fullname string vangelis d-i passwd/username string vangelis d-i passwd/user-password-crypted password $6$asdafdsdfasdfasdf d-i passwd/user-uid string d-i user-setup/allow-password-weak boolean false d-i passwd/user-default-groups string adm cdrom dialout lpadmin plugdev sambashare d-i user-setup/encrypt-home boolean false d-i apt-setup/restricted boolean true d-i apt-setup/universe boolean true d-i apt-setup/backports boolean true d-i apt-setup/services-select multiselect security d-i apt-setup/security_host string security.ubuntu.com d-i apt-setup/security_path string /ubuntu tasksel tasksel/first multiselect Basic Ubuntu server, OpenSSH server d-i pkgsel/include string build-essential htop vim nmap ntp d-i pkgsel/upgrade select safe-upgrade d-i pkgsel/update-policy select none d-i pkgsel/updatedb boolean true d-i grub-installer/only_debian boolean true d-i grub-installer/with_other_os boolean true d-i finish-install/keep-consoles boolean false d-i finish-install/reboot_in_progress note d-i cdrom-detect/eject boolean true d-i debian-installer/exit/halt boolean false d-i debian-installer/exit/poweroff boolean false

    Read the article

  • Slackware Linux: Glib can't find libffi.so.6. Where is it trying to look?

    - by Mathmagician
    I have libffi installed and it's in /usr/local/lib, yet the glib make process can't find it /home/mathmagi/src/glib-2.32.4/gio/.libs/lt-glib-compile-resources: error while loading shared libraries: libffi.so.6: cannot open shared object file: No such file or directory /home/mathmagi/src/glib-2.32.4/gio/.libs/lt-glib-compile-resources: error while loading shared libraries: libffi.so.6: cannot open shared object file: No such file or directory /home/mathmagi/src/glib-2.32.4/gio/.libs/lt-glib-compile-resources: error while loading shared libraries: libffi.so.6: cannot open shared object file: No such file or directory /home/mathmagi/src/glib-2.32.4/gio/.libs/lt-glib-compile-resources: error while loading shared libraries: libffi.so.6: cannot open shared object file: No such file or directory make[4]: Entering directory `/home/mathmagi/src/glib-2.32.4/gio/tests' GEN gdbus-test-codegen-generated.c GEN test_resources.c /home/mathmagi/src/glib-2.32.4/gio/.libs/lt-glib-compile-resources: error while loading shared libraries: libffi.so.6: cannot open shared object file: No such file or directory make[4]: *** [test_resources.c] Error 127 make[4]: Leaving directory `/home/mathmagi/src/glib-2.32.4/gio/tests' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/mathmagi/src/glib-2.32.4/gio' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/mathmagi/src/glib-2.32.4/gio' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/mathmagi/src/glib-2.32.4' make: *** [all] Error 2 It's definitely in /usr/local/lib! bash-4.1# updatedb bash-4.1# locate libffi.so.6 /usr/local/lib/libffi.so.6 /usr/local/lib/libffi.so.6.0.0 /home/mathmagi/src/libffi-3.0.11/x86_64-unknown-linux-gnu/.libs/libffi.so.6 /home/mathmagi/src/libffi-3.0.11/x86_64-unknown-linux-gnu/.libs/libffi.so.6.0.0 With glib I've tried LDFLAGS=-L/usr/local/lib ./configure Doesn't work. How do I find where glib is looking and change it?

    Read the article

  • How is Apache still working?

    - by PJ
    Recently, I decided to set up a local development environment for my work projects. I'm a PHP developer, with just enough knowledge of Linux and Apache to break things mightily. To get the local environment looking like my work environment, I had to upgrade PHP. When I did, Apache wouldn't restart. I decided I wanted to start fresh (this is where things went wrong) and that I'd reinstall Apache and PHP using MacPorts. So, I went through and tried to delete all the Apache files. Yup. I ran locate apache2 and deleted any folders that looked important. (I know, I know) Then I did a /usr/libexec/locate.updatedb to make sure everything was up to date. I even restarted my machine, just to make sure. The issue is, http://localhost still works. As does an alias I set up, http://butler. Shouldn't they not work? Now that I'm this far in, are there any tips for how to completely remove Apache so I can start over? Worst case, I have a timemachine backup, so I can always just restore that... Thanks in advance.

    Read the article

  • How to convert my backup.cmd into something I can run in Linux?

    - by blade19899
    Back in the day when i was using windows(and a noob at everything IT) i liked batch scripting so much that i wrote a lot of them and one i am pretty proud of that is my backup.cmd(see below). I am pretty basic with the linux bash sudo/apt-get/sl/ls/locate/updatedb/etc... I don't really know the full power of the terminal. If you see the code below can i get it to work under (Ubuntu)linux :) by rewriting some of the windows code with the linux equivalent (btw:this works under xp/vista/7 | dutch/english) @echo off title back it up :home cls echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» echo º º echo º typ A/B for the options º echo º º echo ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ echo º º echo º "A"=backup options º echo º º echo º "B"=HARDDISK Options º echo º º echo º º echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍŒ set /p selection=Choose: Goto %selection% :A cls echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» echo º º echo º typ 1 to start that backup º echo º º echo ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ echo º º echo º "A"=backup options º echo º È1=Documents,Pictures,Music,Videos,Downloads º echo º º echo º "B"=HARDDISK Options º echo º º echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍŒ set /p selection=Choose: Goto %selection% :B cls echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» echo º º echo º typ HD to start the disk check º echo º º echo ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ echo º º echo º "A"=backup options º echo º º echo º "B"=HARDDISK Options º echo º ÈHD=find and repair bad sectors º echo º º echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍŒ set /p selection=Choose: Goto %selection% :1 cls if exist "%userprofile%\desktop" (set desk=desktop) else (set desk=Bureaublad) if exist "%userprofile%\documents" (set docs=documents) else (set docs=mijn documenten) if exist "%userprofile%\pictures" (set pics=pictures) else (echo cant find %userprofile%\pictures) if exist "%userprofile%\music" (set mus=music) else (echo cant find %userprofile%\music) if exist "%userprofile%\Videos" (set vids=videos) else (echo cant find %userprofile%\videos) if exist "%userprofile%\Downloads" (set down=downloads) else (echo cant find %userprofile%\Downloads) cls echo. examples (D:\) (D:\Backup) (D:\Backup\18-4-2011) echo. echo. if there is no "D:\backup" folder then the folder will be created echo. set drive= set /p drive=storage: echo start>>backup.log echo Name:%username%>>backup.log echo Date:%date%>>backup.log echo Time:%time%>>backup.log echo ========================================%docs%===========================================>>backup.log echo %docs% echo Source:"%userprofile%\%docs%" echo Destination:"%drive%\%username%\%docs%" echo %time%>>backup.log xcopy "%userprofile%\%docs%" "%drive%\%username%\%docs%" /E /I>>Backup.log echo 20%% cls echo ========================================"%pics%"=========================================>>backup.log echo "%pics%" echo Source:"%userprofile%\%pics%" echo Destination:"%drive%\%username%\%pics%" echo %time%>>backup.log xcopy "%userprofile%\%pics%" "%drive%\%username%\%pics%" /E /I>>Backup.log echo 40%% cls echo ========================================"%mus%"=========================================>>backup.log echo "%mus%" echo Source:"%userprofile%\%mus%" echo Destination:"%drive%\%username%\%mus%" echo %time%>>backup.log xcopy "%userprofile%\%mus%" "%drive%\%username%\%mus%" /E /I>>Backup.log echo 60%% cls echo ========================================"%vids%"========================================>>backup.log echo %vids% echo Source:"%userprofile%\%vids%" echo Destination:"%drive%\%username%\%vids%" echo %time%>>backup.log xcopy "%userprofile%\%vids%" "%drive%\%username%\%vids%" /E /I>>Backup.log echo 80%% cls echo ========================================"%down%"========================================>>backup.log echo "%down%" echo Source:"%userprofile%\%down%" echo Destination:"%drive%\%username%\%down%" echo %time%>>backup.log xcopy "%userprofile%\%down%" "%drive%\%username%\%down%" /E /I>>Backup.log echo end>>backup.log echo %username% %date% %time%>>backup.log echo 100%% cls echo backup Compleet copy "backup.log" "%drive%\%username%" del "backup.log" pushd "%drive%\%username%" echo close backup.log to continue with backup script "backup.log" echo press any key to retun to the main menu pause>nul goto :home :HD echo finds and repairs bad sectors echo typ in harddisk letter (C: D: E:) set HD= set /p HD=Hard Disk: chkdsk %HD% /F /R /X pause goto :home

    Read the article

  • How to get the child of an element being dragged with jQuery UI

    - by Walden
    I have the following html: <div id="gallery"> <ul> <li> <a href="url I want to get">link</a> </li> </ul> </div> and some jQuery that allows it to be dropped on another div: $trash.droppable({ accept: '#gallery > li', activeClass: 'ui-state-highlight', drop: function(ev, ui) { deleteImage(ui.draggable); var $flickrparenturl = $("a").attr("href"); //only gets href of <li> #1, not <li> being dragged $.post("updateDB.php", { 'flickrparenturl': $flickrparenturl } ); } }); What is the correct way to get the href attribute of the child of the element being dragged? $("a").attr("href"); is only getting the href of the 1st li on the page, not the one being dragged.

    Read the article

  • weird problem with load () or live () !!

    - by silversky
    I load a page with load () and then I create dinamically a tag. Then I use live() to bind a click event and fires a function. At the end a call unload (). The problem is that when I load the same page again ( without refresh ) when on click the function will be fired twice. If I exit again (again with unload ()) and load the page again on click will fire 3 times and so on .... A sample of my code is: $('#tab').click(function() { $('#formWrap').load('newPage.php'); }); $('div').after('<p class="ctr" ></p>'); $('p.ctr').live('click', function(e) { if($(e.target).is('[k=lf]')) { console.log ('one'); delete ($this); } else if .... }); function delete () { $.post( 'update.php', data); } I have other $.post inside on this page and also on the above live fnc and all work well. The above one also works but like I said on the second load will fire twice and the 3 times and so on ... The weird part for me is that if replece the console with console.log ('two'); save the page and load the page without refresh it will fire on a different rows - one two - if I unload the page replace the console with console.log ('three'); and load again will fire one two and three. I try to use: $.ajax({ url: 'updateDB.php', data: data, type: 'POST', cache:false }); $.ajaxSetup ({ cache: false }); header("Cache-Control: no-cache"); none of this it's working. And I have this problem only on this fnc. What do you think, it could be the reason, it remembers it remembers the previous action and it fires again?

    Read the article

1 2  | Next Page >