Search Results

Search found 6679 results on 268 pages for 'echo'.

Page 12/268 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • xinetd 'connection reset by peer'

    - by ceejayoz
    I'm using percona-clustercheck (which comes with Percona's XtraDB Cluster packages) with xinetd and I'm getting an error when trying to curl the clustercheck service. /usr/bin/clustercheck: #!/bin/bash # # Script to make a proxy (ie HAProxy) capable of monitoring Percona XtraDB Cluster nodes properly # # Author: Olaf van Zandwijk <[email protected]> # Documentation and download: https://github.com/olafz/percona-clustercheck # # Based on the original script from Unai Rodriguez # MYSQL_USERNAME="clustercheckuser" MYSQL_PASSWORD="clustercheckpassword!" ERR_FILE="/dev/null" AVAILABLE_WHEN_DONOR=0 # # Perform the query to check the wsrep_local_state # WSREP_STATUS=`mysql --user=${MYSQL_USERNAME} --password=${MYSQL_PASSWORD} -e "SHOW STATUS LIKE 'wsrep_local_state';" 2>${ERR_FILE} | awk '{if (NR!=1){print $2}}' 2>${ERR_FILE}` if [[ "${WSREP_STATUS}" == "4" ]] || [[ "${WSREP_STATUS}" == "2" && ${AVAILABLE_WHEN_DONOR} == 1 ]] then # Percona XtraDB Cluster node local state is 'Synced' => return HTTP 200 /bin/echo -en "HTTP/1.1 200 OK\r\n" /bin/echo -en "Content-Type: text/plain\r\n" /bin/echo -en "\r\n" /bin/echo -en "Percona XtraDB Cluster Node is synced.\r\n" /bin/echo -en "\r\n" exit 0 else # Percona XtraDB Cluster node local state is not 'Synced' => return HTTP 503 /bin/echo -en "HTTP/1.1 503 Service Unavailable\r\n" /bin/echo -en "Content-Type: text/plain\r\n" /bin/echo -en "\r\n" /bin/echo -en "Percona XtraDB Cluster Node is not synced.\r\n" /bin/echo -en "\r\n" exit 1 fi /etc/xinetd.mysqlchk: # default: on # description: mysqlchk service mysqlchk { # this is a config for xinetd, place it in /etc/xinetd.d/ disable = no flags = REUSE socket_type = stream port = 9200 wait = no user = nobody server = /usr/bin/clustercheck log_on_failure += USERID only_from = 10.0.0.0/8 127.0.0.1 # recommended to put the IPs that need # to connect exclusively (security purposes) per_source = UNLIMITED } When attempting to curl the service, I get a valid response (HTTP 200, text) but a 'connection reset by peer' notice at the end: HTTP/1.1 200 OK Content-Type: text/plain Percona XtraDB Cluster Node is synced. curl: (56) Recv failure: Connection reset by peer Unfortunately, Amazon ELB appears to see this as a failed check, not a succeeded one. How can I get clustercheck to exit gracefully in a manner that curl doesn't see a connection failure?

    Read the article

  • .php files see Apache environment variables, .html files don't

    - by dotancohen
    Consider this environment: $ cat .htaccess AddType application/x-httpd-php .php .html SetEnv Foo Bar $ cat test.php <?php echo "Hello: "; echo $_SERVER['Foo']; echo $_ENV['Foo']; echo getenv('Foo'); ?> $ cat test.html <?php echo "Hello: "; echo $_SERVER['Foo']; echo $_ENV['Foo']; echo getenv('Foo'); ?> This is the output of test.php: Hello BarBarBar This is the output of test.html: Hello Why might that be? How might I fix it? Here is phpinfo.php: http://pastebin.com/rgq7up61 Here is phpinfo.html: http://pastebin.com/VUKFNZ36 If anyone knows where I can host a real webpage instead of just the HTML for one, please let me know and I'll move the content to there. Thanks.

    Read the article

  • Shell Script if else

    - by user34104
    #!/bin/bash echo "Int. a number" read num1 echo "Int. another numer" read num2 if ["$num1"="$num2"]; then echo "Equals" else echo "Dif" fi if["$num1"<0]; then echo "The number $num1 is negative" else if ["$num2"<0]; then echo "The number $num2 is negative" fi # this code is not working, i've something wrong when i see if the number is < 0. thanks

    Read the article

  • rsync creating thousands of ..ds_store files from mounted volume

    - by daniel Crabbe
    I've been using rsync on OS X to sync all our website admins. It was working fine until the OS X 10.6.3 update! Now it creates thousands of empty (0-kb) folders. It only does it when synching to a mounted network drive (which we need to do) as when I sync to my local drive it works as usual! I've tried excludes which don't seem to be working... also tried a different version of rsync so it's an OS X issue. echo "" echo "~*~*~*~*~*~*~*~*~*~*~*~*~*" echo " SYNCING up KINEMASTIK" echo "~*~*~*~*~*~*~*~*~*~*~*~*~*" /usr/local/bin/rsync -aNHAXv --progress --exclude-from 'exclude.txt' /Volumes/Groups/Projects/483_Modern_Activity_Website/web/youradmin/ /Users/dan/Dropbox/documents/WORK/kinemastik/WEBSITE/youradmin/ echo "" echo "~*~*~*~*~*~*~*~*~*~*~*~*~*" echo " SYNCING up CHRIS BROOKS YOURADMIN" echo "~*~*~*~*~*~*~*~*~*~*~*~*~*" /usr/local/bin/rsync -aNHAXv --progress --exclude-from 'exclude.txt' /Volumes/Groups/Projects/483_Modern_Activity_Website/web/youradmin/ /Volumes/Groups/Projects/516_ChrisBrooks/website/youradmin/ Has anyone experienced the same problem?

    Read the article

  • Install VLC 2.0.7 in CentOS 6.4?

    - by raaz
    I am keep failing in the installation process I have tried. I have started process as follows. yum install gcc dbus-glib-devel* lua-devel* libcddb wget http://download.videolan.org/pub/videolan/vlc/2.0.7/vlc-2.0.7.tar.xz tar -xf vlc-2.0.7.tar.xz && cd vlc-2.0.7 ./configure in the configure I am getting the error as follows configure: WARNING: No package 'libcddb' found: CDDB access disabled. checking for Linux DVB version 5... yes checking for DVBPSI... no checking gme/gme.h usability... no checking gme/gme.h presence... no checking for gme/gme.h... no checking for SID... no configure: WARNING: No package 'libsidplay2' found (required for sid). checking for OGG... no configure: WARNING: Library ogg >= 1.0 needed for ogg was not found checking for MUX_OGG... no configure: WARNING: Library ogg >= 1.0 needed for mux_ogg was not found checking for SHOUT... no configure: WARNING: Library shout >= 2.1 needed for shout was not found checking ebml/EbmlVersion.h usability... no checking ebml/EbmlVersion.h presence... no checking for ebml/EbmlVersion.h... no checking for LIBMODPLUG... no configure: WARNING: No package 'libmodplug' found No package 'libmodplug' found. checking mpc/mpcdec.h usability... no checking mpc/mpcdec.h presence... no checking for mpc/mpcdec.h... no checking mpcdec/mpcdec.h usability... no checking mpcdec/mpcdec.h presence... no checking for mpcdec/mpcdec.h... no checking for libcrystalhd/libcrystalhd_if.h... no checking mad.h usability... no checking mad.h presence... no checking for mad.h... no configure: error: Could not find libmad on your system: you may get it from http://www.underbit.com/products/mad/. Alternatively you can use --disable-mad to disable the mad plugin. [root@localhost vlc-2.0.7]# So I went to libmad http location and downloaded it and while doing make it gave me the errors.There are no errors at ./configure with libmad but make not going through. [root@localhost libmad-0.15.0b]# make (sed -e '1s|.*|/*|' -e '1b' -e '$s|.*| */|' -e '$b' \ -e 's/^.*/ *&/' ./COPYRIGHT; echo; \ echo "# ifdef __cplusplus"; \ echo 'extern "C" {'; \ echo "# endif"; echo; \ if [ ".-DFPM_INTEL" != "." ]; then \ echo ".-DFPM_INTEL" | sed -e 's|^\.-D|# define |'; echo; \ fi; \ sed -ne 's/^# *define *\(HAVE_.*_ASM\).*/# define \1/p' \ config.h; echo; \ sed -ne 's/^# *define *OPT_\(SPEED\|ACCURACY\).*/# define OPT_\1/p' \ config.h; echo; \ sed -ne 's/^# *define *\(SIZEOF_.*\)/# define \1/p' \ config.h; echo; \ for header in version.h fixed.h bit.h timer.h stream.h frame.h synth.h decoder.h; do \ echo; \ sed -n -f ./mad.h.sed ./$header; \ done; echo; \ echo "# ifdef __cplusplus"; \ echo '}'; \ echo "# endif") >mad.h make all-recursive make[1]: Entering directory `/home/raja/Downloads/libmad-0.15.0b' make[2]: Entering directory `/home/raja/Downloads/libmad-0.15.0b' if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_INTEL -DASO_ZEROCHECK -Wall -march=i486 -g -O -fforce-mem -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -fstrength-reduce -MT version.lo -MD -MP -MF ".deps/version.Tpo" \ -c -o version.lo `test -f 'version.c' || echo './'`version.c; \ then mv -f ".deps/version.Tpo" ".deps/version.Plo"; \ else rm -f ".deps/version.Tpo"; exit 1; \ fi mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_INTEL -DASO_ZEROCHECK -Wall -march=i486 -g -O -fforce-mem -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -fstrength-reduce -MT version.lo -MD -MP -MF .deps/version.Tpo -c version.c -fPIC -DPIC -o .libs/version.lo cc1: error: unrecognized command line option "-fforce-mem" make[2]: *** [version.lo] Error 1 make[2]: Leaving directory `/home/raja/Downloads/libmad-0.15.0b' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/raja/Downloads/libmad-0.15.0b' make: *** [all] Error 2 how can i resolve the issue and install VLC in my Centos ? I am using CentOS 6.4 . Thank you.

    Read the article

  • Scheduled service/script/batch file to move files on condition of other files with similar filenames in same directory on windows

    - by ilasno
    On Windows Server (Data Center? 2008?), i'm trying to set up a scheduled task that will: Within a particular directory For every file in it If there exists (in the same directory) 2 files with similar names (actually the same name with extra extensions tagged on, ie. 'file1.mov' would need both 'file1.mov.flv' AND 'file1.mov.mpg' to exist), then move the file to another directory on a different disk. Following is what i have so far for a batch file, but i'm struggling. I'm also open to another technique/mechanism. @setlocal enableextensions enabledelayedexpansion @echo off SET MoveToDirectory=M:\_SourceVideosFromProduction ECHO MoveToDirectory=%MoveToDirectory% pause for /r %%i in (*) do ( REM ECHO %%i REM ECHO %%~nxi REM ECHO %%~ni REM ECHO filename=%filename% REM SET CurrentFilename=%%~ni REM ECHO CurrentFilename=%CurrentFilename% IF NOT %%~ni==__MoveSourceFiles ( IF NOT x%%%~ni:\.=%==x%%%~ni% DO ( REM SET HasDot=0 REM FOR /F %%g IN %filename% do ( REM IF %%g==. ( ECHO %filename% REM ) ) ) ) pause

    Read the article

  • bridge to share WiFi internet connection over eth0

    - by rubo77
    In this script there is implemented that you create a mesh network and connect other machines to your device to serve an internet connection with dhcp: echo "starting bridge to share internet connection over eth0" ifconfig eth0 up promisc brctl addbr br-freifunk brctl addif br-freifunk bat0 brctl addif br-freifunk eth0 echo "internet starting, this may take some minutes due to latency..." echo "(use" echo "tail -f /var/log/syslog" echo "in another window for debugging)" echo echo dhclient br-freifunk echo "The error 'Rather than invoking init scripts through /etc/init.d...' can be ignored:" dhclient br-freifunk # without bridge: dhclient bat0 This works fine with the freifunk-mesh network. But how can I serve internet in a normal case? I would like to connect to any open Wifi I find with my network-manager or wicd (yes, with the graphical GUI) and then start a small script that creates a bridge to my network-out on my laptop I use Ubuntu and my networkcards are eth0 and wlan0

    Read the article

  • Variable Assignment for arguments with a for loop

    - by RainbowDashDC
    Alright, so, I've searched quite a bit on how to do this but I've given up as I simply couldn't find anything. So, I have a code (below); it's main purpose is to get 9 arguments and assign them as a variable-- ignore the echo's and pipping. My question is: How can I simplfy this with a for loop or such so it doesn't take as much code, and if possible, have more than 9 arguments aswell set pkg1=%1 set pkg2=%2 set pkg3=%3 set pkg4=%4 set pkg5=%5 set pkg6=%6 set pkg7=%7 set pkg8=%8 set pkg9=%9 IF DEFINED pkg1 (echo %1.ini 1> %WINGET_TEMP%\args.rdc 2>nul) IF DEFINED pkg2 (echo %2.ini 1>> %WINGET_TEMP%\args.rdc 2>nul) IF DEFINED pkg3 (echo %3.ini 1>> %WINGET_TEMP%\args.rdc 2>nul) IF DEFINED pkg4 (echo %4.ini 1>> %WINGET_TEMP%\args.rdc 2>nul) IF DEFINED pkg5 (echo %5.ini 1>> %WINGET_TEMP%\args.rdc 2>nul) IF DEFINED pkg6 (echo %6.ini 1>> %WINGET_TEMP%\args.rdc 2>nul) IF DEFINED pkg7 (echo %7.ini 1>> %WINGET_TEMP%\args.rdc 2>nul) IF DEFINED pkg8 (echo %8.ini 1>> %WINGET_TEMP%\args.rdc 2>nul) IF DEFINED pkg9 (echo %9.ini 1>> %WINGET_TEMP%\args.rdc 2>nul)

    Read the article

  • PHP Sessions suddenly not working

    - by styrken
    Out of no where my php sessions does not work anymore. The server have been running fine for several months. I'am running Ubuntu 11.10 (GNU/Linux 3.0.0-14-server x86_64) with nginx/1.0.11 and php 5.3.19-1~dotdeb.0 Session info copied from phpinfo() Session Support enabled Registered save handlers files user memcached Registered serializer handlers php php_binary wddx Directive Local Value Master Value session.auto_start Off Off session.bug_compat_42 Off Off session.bug_compat_warn Off Off session.cache_expire 180 180 session.cache_limiter nocache nocache session.cookie_domain no value no value session.cookie_httponly Off Off session.cookie_lifetime 0 0 session.cookie_path / / session.cookie_secure Off Off session.entropy_file no value no value session.entropy_length 0 0 session.gc_divisor 1000 1000 session.gc_maxlifetime 1440 1440 session.gc_probability 0 0 session.hash_bits_per_character 5 5 session.hash_function 0 0 session.name PHPSESSID PHPSESSID session.referer_check no value no value session.save_handler files files session.save_path /tmp /tmp session.serialize_handler php php session.use_cookies On On session.use_only_cookies On On session.use_trans_sid 0 0 I have setup the following php script to test with: error_reporting(E_ALL); ini_set('display_errors', true); error_log($_SERVER['REMOTE_ADDR'] . ' visited test page'); if(session_start()) echo "Session started <br />"; else echo "Session failed <br />"; echo '<a href="?', time(), '">refresh</a>', "\n"; echo '<pre>'; echo 'session id: ', session_id(), "\n"; $sessionfile = ini_get('session.save_path') . '/' . 'sess_'.session_id(); echo 'session file: ', $sessionfile, ' '; if ( file_exists($sessionfile) ) { echo 'size: ', filesize($sessionfile), "\n"; echo '# ', file_get_contents($sessionfile), ' #'; } else { echo ' does not exist'; } echo PHP_EOL; $_SESSION['number'] = (int) @$_SESSION['number'] + 1; var_dump($_SESSION); echo "</pre>\n"; session_write_close(); echo 'done.'; It tells me that the session file exists, but my session id changes on each refresh.. What is going wrong? There is no output to any error logs at all.. :/ Please help!

    Read the article

  • Select (loop) or command not working in shell-script

    - by user208098
    I've been tinkering with Linux and Unix for years but still a novice in my mind and recently find myself trying to be more pro with it as I work in IT. So with that notion I'm studying shell scripting. I've hit a snag in ubuntu using the latest version 13.10 Saucy. When I use the select command in a sh script it doesn't work, depending on how I format the command it will either return Unexpected "do" or Unexpected "done". See the following two examples: This section of code produces an unexpected "do" error: #/bin/bash PS3='Please enter your choice' select opt in option1 option2 option3 quit do case $opt in "option1") echo "you chose choice 1" ;; "option2") echo "you chose choice 2" ;; "option3") echo "you chose choice 3" ;; "quit") break ;; *) echo invalid option ;; esac done This section of code produces an unexpected "done" error. #/bin/bash PS3='Please enter your choice' select opt in option1 option2 option3 quit ; do case $opt in "Option1") echo "you chose choice 1" ;; "Option2") echo "you chose choice 2" ;; "Option3") echo "you chose choice 3" ;; "quit") break ;; *) echo invalid option ;; esac done When I enter these parameters into the command line interactively or manually I get the desired result which is a list of choices to choose from. However when executed from a script I get the before mentioned errors. Also a side note I have tried this in Fedora as a script and it worked perfectly so my question is why isn't it working in Ubuntu, is this a difference between RHL and Debian? Or is it a bug in the latest version of Ubuntu? Thanks in advance for any help! KG

    Read the article

  • May I define aliases elsewhere than into .bashrc ?

    - by Luc M
    We are several persons using the same login id on Linux Box. I want to define my own aliases without interfering with anyone. In the .bashrc, I define a alias to my bash file defining my own aliases. alias luc=/full/path/to/my/def_alias_luc.sh The file /full/path/to/my/def_alias_luc.sh contains #!/bin/bash echo "" echo "Defining Luc's aliases" echo "" echo "" echo "aliases before..." echo "" alias alias vimluc="vim -u /full/path/to/my/.vimrc " echo "" echo "aliases after" echo "" alias After executing /full/path/to/my/def_alias_luc.sh, the alias is still undefined. What do I miss ?

    Read the article

  • mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in

    - by user2533440
    I cannot figure out whats wrong with this code. Every time i try to run this file I get error mysql_fetch_assoc() expects parameter 1 to be resource <?php $q = "select * from tbfood"; $rs = mysql_query($q); while($msg = mysql_fetch_assoc($rs)){ echo "<p>".$msg["name"]."</p>"; echo "<p>".$msg["price"]."</p>"; if ($msg['idDruh'] == 1) { echo "string1"; } elseif ($msg['idDruh'] == 2) { echo "string2"; } elseif ($msg['idDruh'] == 3) { echo "string3"; } elseif ($msg['idDruh'] == 4) { echo "string4"; } elseif ($msg['idDruh'] == 5) { echo "string5"; } elseif ($msg['idDruh'] == 6) { echo "string6"; } elseif ($msg['idDruh'] == 7) { echo "string7"; } } ?>

    Read the article

  • How to use crontab, .netrc, and git push?

    - by Jon
    Hi all, I am in the process of automating the backups from various servers to a central point then pushing those config changes into a git repo so i can track any changes over time. The rest of the scripts are working well, I can copy / rsync the files across the network to a central point. The last script is to get the config files to be put into / updated in repository. The script is as follows: #!/bin/bash clear SERVERNAME="betty" SCRIPTDIR="/home/jon" GITROOT="/tmp/git" TEMPROOT="/tmp/backups" BACKUPROOTDIR="/mnt/backups" echo " - running as user: $UID" echo "backingup git config on $SERVERNAME" echo "" # check to see if root backup folder exists, otherwise create it. if [ -d $GITROOT ]; then rm -rf $GITROOT fi mkdir $GITROOT cd $GITROOT echo " - testing if home is where I think it should be!" echo $HOME echo " - testing if it can see netrc" tail $HOME/.netrc git clone http://192.168.10.97:8000/repositories/HOH-config-backups.git cd HOH-config-backups echo " - copy Configuration Folders across" cp -r $BACKUPROOTDIR/Configuration/* $GITROOT/HOH-config-backups/ cp -r $BACKUPROOTDIR/scripts $GITROOT/HOH-config-backups/ git add . git commit -a -m "committing any new configuration changes!" git push origin master echo "" echo "Git repo updated" echo "" echo " - backing up this script" FIREWIGSCRIPTLOC="$BACKUPROOTDIR/scripts/$SERVERNAME" if [ ! -d $FIREWIGSCRIPTLOC ]; then mkdir $FIREWIGSCRIPTLOC fi cp /home/jon/gitConfig.sh $FIREWIGSCRIPTLOC The git repo is on a different machine in the network using Apache and HTTP-backend.exe (smart HTTP protocol). If I run this script as me "jon" it works. If I run it in crontab it fails. git uses the /home/jon/.netrc file for authentication: machine 192.168.10.97 login gitconfig password 1234579 The log from crontab is: TERM environment variable not set. - running as user: 1000 backingup git config on betty - testing if home is where I think it should be! /home/jon - testing if it can see netrc machine 192.168.10.97 login gitconfig password 1234579 got 08de5bc2b27b4940d9412256e76d5e3c3d9dbcdd walk 08de5bc2b27b4940d9412256e76d5e3c3d9dbcdd got be880f2d306778a538d592e7a02eb19f416612f7 got bd387e8def9f77aafa798bf53e80d949aba443e8 got 1bc1a59e12775841d4c59d77c63b8a73823138c2 walk bd387e8def9f77aafa798bf53e80d949aba443e8 Getting alternates list for http://192.168.10.97:8000/repositories/HOH-config-backups.git got 030512237bca72faf211e0e8ec2906164eac34f6 got 9bc2f575240bc1f61ff7d69777ce1a165d06b184 got b8400f7f01429104a9d4786a6bb1a16d293e37c1 got 2403b5bf611010e0b401f776f0e23b09ce744838 got 1a27944c48269ef3608a8f2466e43402d06faac0 got b686f45b7d57af4fa8ca0d528bb85216d6247e19 Getting pack list for http://192.168.10.97:8000/repositories/HOH-config-backups.git Getting index for pack ae881957c0f0e8c22eb6cc889a22ef78eb4ce6ff Getting pack ae881957c0f0e8c22eb6cc889a22ef78eb4ce6ff which contains ff84d6d48e9326066438d167a10251218d612b3d walk b686f45b7d57af4fa8ca0d528bb85216d6247e19 got 364e30daec17814073e668f490bb84af891fe1f7 got 23f6497e7f9b80e0d90adad73bd0407a0e5ac6ce got 9e77c47574b5e23ea669afe0c23ab235e4917ee1 got 6654e0d328a216b3783e98c47206cb2d01b3353d got 28821ffd437d2689ffb82c6e4b9c3f5372c95c4b got 8c384a24f645389e4d4b08013c79e9e73a658342 got d203be0123736ee025ce20c081f1489098648dfc got 1852603bf7709e71417d8ccec02390279d533642 got fb753a26b20b04694419fce8ecdaa8dbec105cf1 got 736028997cd84dd1c135f57e9d246674b9cd0b9d got 7af836249e20096d0476a548d5be702a071cdd4b got 240dc39d9db50df63073fc7927b2d002dfa0f54c got 93abd36e3935a01011eb753b635a1a0e984bf31e got c6269e28fecf4d8d0d98b9358aecb3acff02df44 got b0aa29432f73e64032682a351d436c24b14078ab walk 240dc39d9db50df63073fc7927b2d002dfa0f54c got 58fb66d9f35f8a5e32ff4683309c5f0c2a3a03c5 got 0da2def4de0565483cdbe6b87418ee2beb122e58 got 0f6a86c6f87ed52ad2ed01e5c6edd661d364930c got 437a93d27b5bb89c739a0564a34a616e832c3ebe got fe0385abe5c0acd8462268dac330bae00e934f1b got 24259f8f5c5c9ee974a75fe3d1e07c02e3e20fe9 got d29f624bf1a5eceedaa86c10fee35f62747c7d04 got 0154e4c987132585ea7a92b77d02dba285512d6b got eda8bf526567c25ee70addb2ad3c3c6aa57eac77 got 9f3d9d7262d66f9fa4f6a13b7c86199953f4bc4e got 8e20881e19667aa22245d0598646991067455a4d got abb1123145689b35eb19519952c71253ee45fa98 got dfeff593c79b4156ce2ce1adf043d0e80356488c got e20c5b48b1d360e0bcf34189e3f3d2bbf23e92cc got b13eb81cc274780322ecf786372320343926bec9 walk 8de83868b3fac748b0a55eba16c8f668ec852abb got b5961421bbc42afe7a07cc1c8b615aba26ba74d7 got 2650ba819019df4193b482733e29ca79b29f3f2c got b3111e1be8103e91803a97a817ed81f28025aca1 got b060be934d709684f5eb5dad3c03932a3589e864 got cf70d2043f081d7a4438e9d5a290a9f986c84060 got 80bf0f1cc836feab86d6935bb7968d8555a8d531 got da318d167920e34bc6573e4fc236249ccbbee316 got d82ac853d387b760149599e6e1ab96403f6ec672 got 0005f691d1f46550fdb4e56025f52e30a5b18cc2 Initialized empty Git repository in /tmp/git/HOH-config-backups/.git/ - copy Configuration Folders across Created commit 424df2f: committing any new configuration changes! 3 files changed, 55 insertions(+), 1 deletions(-) create mode 100755 scripts/betty/gitConfig.sh error: Cannot access URL http://192.168.10.97:8000/repositories/HOH-config-backups.git/, return code 22 error: failed to push some refs to 'http://192.168.10.97:8000/repositories/HOH-config-backups.git' Git repo updated - backing up this script cp: cannot create regular file `/mnt/backups/scripts/betty/gitConfig.sh': Permission denied my crontab is: # m h dom mon dow command 04 * * * * /home/jon/gitConfig.sh > /tmp/gitconfig.log 2>&1 I open it by doing: $crontab -e i.e. not as root. I am a bit confused as to why it is not running as my user (or what user id 1000 is). Not sure what I need to do to get the push with git to work within crontab. edit: found out about the userid: jon@betty:~$ id uid=1000(jon) gid=1000(jon) groups=4(adm),20(dialout),24(cdrom),46(plugdev),109(sambashare),114(lpadmin),115(admin),1000(jon) here is my $HOME/.gitconfig file: [user] name = Jon Hawkins email = [email protected] Thanks

    Read the article

  • Why does redirecting "sudo echo" stdout to a file not give root ownership?

    - by orokusaki
    I'm pretty new to using Linux heavily, and I'm trying to learn more about file ownership and permissions. One thing that I stumbled on just now was exactly what the title says, running: weee@my-server:~$ sudo echo "hello" > some-file.txt weee@my-server:~$ ls -lh total 4.0K -rw-rw-r-- 1 weee weee 6 Dec 5 21:21 some-file.txt The file is owned by me, whereas touch works like one would expect: weee@my-server:~$ sudo touch other-file.txt weee@my-server:~$ ls -lh total 4.0K -rw-r--r-- 1 root root 0 Dec 5 21:22 other-file.txt How can I force the file to be created by root? Do I simply have to create the file in my homedir, then sudo chown root... and sudo mv ... move it to /var where I need it to be? I was hoping there'd be a single step to accomplish this.

    Read the article

  • How do I solve this "unexpected '}' syntax error" in my bash script?

    - by WASasquatch
    I have a piece of code that has some serious issues and I was hoping to get it solved soon but no one has offered any help. I thought I'd try some Ubuntu users since this is the OS running the script. mc_addplugin() { if pgrep -u $USERNAME -f $SERVICE > /dev/null then echo "$SERVICE is running! Please stop the service before adding a plugin." else echo "Paste the URL to the .JAR Plugin..." read JARURL JARNAME=$(basename "$JARURL") if [ -d "$TEMPPLUGINS" ] then as_user "cd $PLUGINSPATH && wget -r -A.jar $JARURL -o temp_plugins/$JARNAME" else as_user "cd $PLUGINSPATH && mkdir $TEMPPLUGINS && wget -r -A.jar $JARURL -o temp_plugins/$JARNAME" fi if [ -f "$TMPDIR/$JARNAME" ] then if [ -f "$PLUGINSPATH/$JARNAME" ] then if `diff $PLUGINSPATH/$JARNAME $TMPDIR/$JARNAME >/dev/null` then echo "You are already running the latest version of $JARNAME." else NOW=`date "+%Y-%m-%d_%Hh%M"` echo "Are you sure you want to overwrite this plugin? [Y/n]" echo "Note: Your old plugin will be moved to the "$TEMPPLUGINS" folder with todays date." select yn in "Yes" "No"; do case $yn in Yes ) as_user "mv $PLUGINSPATH/$JARNAME $TEMPPLUGINS/${JARNAME}_${NOW} && mv $TEMPPLUGINS/$JARNAME $PLUGINSPATH/$JARNAME"; break;; No ) echo "The plugin has not been installed! Removing temporary plugin and exiting..." as_user "rm $TEMPPLUGINS/$JARNAME"; exit;; esac done echo "Would you like to start the $SERVICE now? [Y/n]" select yn in "Yes" "No"; do case $yn in Yes ) mc_start; break;; No ) "$SERVICE not running! To start the service run: /etc/init.d/craftbukkit start"; exit;; esac done fi else echo "Are you sure you want to add this new plugin? [Y/n]" select yn in "Yes" "No"; do case $yn in Yes ) as_user "mv $PLUGINSPATH/$JARNAME $TEMPPLUGINS/${JARNAME}_${NOW} && mv $TEMPPLUGINS/$JARNAME $PLUGINSPATH/$JARNAME"; break;; No ) echo "The plugin has not been installed! Removing temporary plugin and exiting..." as_user "rm $TEMPPLUGINS/$JARNAME"; exit;; esac done echo "Would you like to start the $SERVICE now? [Y/n]?" select yn in "Yes" "No"; do case $yn in Yes ) mc_start; break;; No ) "$SERVICE not running! To start the service run: /etc/init.d/craftbukkit start"; exit;; esac done fi else echo "Failed to download the plugin from the URL you specified!" exit; fi } It throws it at the closing bracket at the end of the function.

    Read the article

  • How do I echo the number of items in an array?

    - by Joel
    A total newbie question I know. I'm sing Zend framework, and sending an array from the controller: $this->view->googleArray = $viewFeedArray; In the view, I have a foreach loop that is populating a table with the array contents. <?php foreach($this->googleArray as $row) { ?> <tr> <td><?php echo $row['when']; ?></td> ... ... </tr> <?php } ?> It all works fine. At the top of the table, I want to list the number of items in the array. Something like (which doesn't work): <?php echo $this->googleArray->totalResults; ?> event(s) found How would I do that? Thanks!

    Read the article

  • $(document).ready(function(){ executed every time on onclick event of Hyperlink?

    - by Photon Critical Fatal Error_
    In my code I'm creating a product list dynamically using PHP(see image) and the currosponding labels and image paths are stored into hidden fields(created dynamically using PHP) now on document.ready() method i set the first list item's imagepath to img's src and its remarks to label remarks using first hidden fields for remark and imagepath. and on listitem click i want to change it my function set these values to img and label rightly(checked using alerts) but when function ends it set the image src and remarks innertext to default that is set on document.ready() method now my question is can i prevent the document.ready() to be executed next time on javascript function call My View : As the images are reloaded so the page rendering is done again so the document.ready is called again and set these values again to default. Note : My page is not reloading any time only images and labels are being changed The listshown in image is just one group other group is also created dynamically . server side code in PHP <?php for($j=0;$j<count($productstr);$j++) { $valuerem = $productstr[$j]["pcode"]; $idrem = "rem".$j.$grp; $valueimg =$productstr[$j]["imgpath"]; $idimg = "img".$j.$grp; echo "<input type='hidden' value='$valuerem' id='$idrem' />" ; echo "<input type='hidden' value='$valueimg' id='$idimg' />" ; }?> <script> $(document).ready(function() { idrv < ? PHP echo $grp; ? > = 'rem0<?PHP echo $grp; ?>'; idmv < ? PHP echo $grp; ? > = 'img0<?PHP echo $grp; ?>'; $('#txt<?PHP echo $grp; ?>').text(document.getElementById(idrv < ? PHP echo $grp; ? ).value); alert($('#txt<?PHP echo $grp; ?>').text()); $('#img<?PHP echo $grp; ?>').attr('src', document.getElementById(idmv < ? PHP echo $grp; ? > ).value); alert($('#img<?PHP echo $grp; ?>').attr('src')); }); function Change(id) { idrv < ? PHP echo $grp; ? > = 'rem' + id; idmv < ? PHP echo $grp; ? > = 'img' + id; $('#txt<?PHP echo $grp; ?>').text(document.getElementById(idrv < ? PHP echo $grp; ? > ).value); alert($('#txt<?PHP echo $grp; ?>').text()); $('#img<?PHP echo $grp; ?>').attr('src', document.getElementById(idmv < ? PHP echo $grp; ? > ).value); alert($('#img<?PHP echo $grp; ?>').attr('src')); return true; }? </script> alerts are used just to test the values the code that are being generated at client browser <tr> <td width="220px" valign="top" align="left"> <input id="YN" type="hidden" value="true"> <input id="rem00" type="hidden" value="SPL FUNNEL 1"> <input id="img00" type="hidden" value="adminpanel/product_images/4f8e530154d74155.jpg"> <input id="rem10" type="hidden" value="SPL FUNNEL 2"> <input id="img10" type="hidden" value="adminpanel/product_images/4f8e53daf13e6156.jpg"> <input id="rem20" type="hidden" value="SPL FUNNEL 3"> <input id="img20" type="hidden" value="adminpanel/product_images/4f8e543100eaf157.jpg"> <input id="rem30" type="hidden" value="SPL FUNNEL 4"> <input id="img30" type="hidden" value="adminpanel/product_images/4f8e545a829e1158.jpg"> <script> $(document).ready(function() { idrv0 = 'rem00'; idmv0 = 'img00'; $('#txt0').text(document.getElementById(idrv0).value); alert($('#txt0').text()); $('#img0').attr('src', document.getElementById(idmv0).value); alert($('#img0').attr('src')); }); function Change(id) { $('#YN').val('false'); idrv0 = 'rem' + id; idmv0 = 'img' + id; $('#txt0').text(document.getElementById(idrv0).value); alert($('#txt0').text()); $('#img0').attr('src', document.getElementById(idmv0).value); alert($('#img0').attr('src')); return true; }? </script> <ul> <li> <a id="00" style="text-decoration: none; text-size: 1.1em; color: " onclick=" Change(this.id); alert($('#txt0').text()); alert($('#img0').attr('src'));"> SPL FUNNEL 1</a> </li> <li> <li> <li> </ul> </td> <td valign="bottom" align="left" colspan="2"> <td width="110px" valign="bottom" align="left" style="width: 180px"> </tr>

    Read the article

  • Is there a way to echo this only once and not have it repeat?

    - by Fernando
    I have the following query: $select = mysql_query("SELECT * FROM posts WHERE id = $postIds"); while ($return = mysql_fetch_assoc($select)) { $postUrl = $return['url']; $postTitle = $return['title']; echo "<h1><a href='$postUrl'>".$postTitle."</a></h1>"; } Now the problem is, the variable $postIds often times contain the same id multiple times. So the title of the post echos itself multiple times. Is there a way to have it echo only once?

    Read the article

  • Sending mail php

    - by user195257
    Hey, no idea why this sint working, but the message is being sent as "0". I think the e-mail form is what is causing it <?php if ($_POST['check'] == 'checked'){ header("location: /nospamplease.html"); exit(); } $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $date = $_POST['date']; $children = $_POST['children']; $hot = $_POST['hot']; $comments = $_POST['comments']; /*echo $name; echo $email; echo $phone; echo $date; echo $children; echo $hot; echo $comments;*/ if($name == "" || $email == "" || $phone == "" || $date == "" || $children == "" || $hot == "" || $comments == ""){ echo "Please ensure all fields were filled out!"; exit(); }else{ $to = "######"; $subject = "Birthday enquiry"; $message = $message + "Name: "+$name; $message = $message + "Email: "+$email; $message = $message + "Phone: "+$phone; $message = $message + "Date: "+$date; $message = $message + "Children: "+$children; $message = $message + "Hot or cold: "+$hot; $message = $message + "Comments: "+$comments; //echo $message; if(mail($to, $subject, $message)){ echo "Thank you for your enquiry, we will contact you within the next 24 hours! <br /> Click <a href='###'> here</a> to go back to the website!"; }else{ echo "There was an error, contact us directly: <a href='mailto:##'>email</a>"; } } ?> I echoed out the variables, they all are getting posted fine Thanks guys

    Read the article

  • how to create an function using jquery live? [Solved]

    - by Mahmoud
    Hey all i am trying to create a function that well keep the user in lightbox images while he adds to cart, for a demo you can visit secure.sabayafrah.com username: mahmud password: mahmud when you click at any image it well enlarge using lightbox v2, so when the user clicks at the image add, it well refresh the page, when i asked about it at jcart support form they informed me to use jquery live, but i dont know how to do it but as far as i tried this code which i used but still nothing is happening jQuery(function($) { $('#button') .livequery(eventType, function(event) { alert('clicked'); // to check if it works or not return false; }); }); i also used jQuery(function($) { $('input=[name=addto') .livequery(eventType, function(event) { alert('clicked'); // to check if it works or not return false; }); }); yet nothing worked for code to create those images http://pasite.org/code/572 Update 1: i have done this function adding(form){ $( "form.jcart" ).livequery('submit', function() {var b=$(this).find('input[name=<?php echo $jcart['item_id']?>]').val();var c=$(this).find('input[name=<?php echo $jcart['item_price']?>]').val();var d=$(this).find('input[name=<?php echo $jcart['item_name']?>]').val();var e=$(this).find('input[name=<?php echo $jcart['item_qty']?>]').val();var f=$(this).find('input[name=<?php echo $jcart['item_add']?>]').val();$.post('<?php echo $jcart['path'];?>jcart-relay.php',{"<?php echo $jcart['item_id']?>":b,"<?php echo $jcart['item_price']?>":c,"<?php echo $jcart['item_name']?>":d,"<?php echo $jcart['item_qty']?>":e,"<?php echo $jcart['item_add']?>":f} }); return false; } and it seems to add to jcart but yet it still refreshes

    Read the article

  • Wordpress display featured posts outside of loop

    - by Thomas
    Im new to WP and Im not real sure how to work with the loop. I am trying to display featured posts in the sidebar with this code: <?php query_posts('cat=5'); $url = get_permalink(); while(have_posts()){ the_post(); $image_tag = wp_get_post_image('return_html=true'); $resized_img = getphpthumburl($image_tag,'h=168&w=168&zc=1'); $title = $post->post_title; echo "<ul class='left_featured'>"; echo "<li><a href='"; echo $url; echo "'><img src='$resized_img' width='168' height='168' "; echo "'/></a></li>"; echo "<li><a href='"; echo $url; echo "'/>"; echo $title; echo "</a></li></ul>"; echo ""; }; ?> This gives me all sorts of crazy outputs, text from random posts, images, etc...Its supposed to output a list of images and titles for all of the posts in a certain category. Any help would be really appreciated. Oh yeah, I am using a plugin that resizes images on the fly, thats what the the wp_get_post_image/getphpthumburl business is.

    Read the article

  • Value is not changing in the javascript variable on the onClick event

    - by Chetan sharma
    I am trying to implement a dynamic search jquery and php, but I am not able to change the value of a javascript variable on my onclick event. <script type="text/javascript"> var main_category = '<?php echo $main_category?>'; var main_url = '<?php echo $url?>get/' + encodeURIComponent(main_category) + '/'; var container_id = '<?php echo $unique_id?>content_area'; //name $('#<?php echo $unique_id?>search_by_name').autocomplete('<?php echo $url?>get_autocomplete_data/' + encodeURIComponent(main_category) + '/names/', { matchContains: "word", autoFill: true, width: 310 });$('#<?php echo $unique_id?>search_by_name').result(function (event, data){ var url = main_url + 'search/title/' + encodeURIComponent(data); load_div(container_id, url); }); //on click of displayed categories $('[rel="<?php echo $unique_id?>sub_category"]').click(function (){ window['main_category'] = this.title; $('#<?php echo $unique_id?>category').html('' +main_category+ ''); return false; }); }); </script> It changes the value when on click is fired //on click of displayed categories $('[rel="<?php echo $unique_id?>sub_category"]').click(function (){ window['main_category'] = this.title; $('#<?php echo $unique_id?>category').html('' +main_category+ ''); return false; }); but when after that i add data for the search it still searches for the old category $('#<?php echo $unique_id?>search_by_name').result(function (event, data){ var url = main_url + 'search/title/' + encodeURIComponent(data); load_div(container_id, url); }); "main_category" value is not changing in the "main_url"

    Read the article

  • Displaying code with <pre> tags.

    - by iMaster
    Currently I'm using <pre><code> code here </code><pre> to display code. I'm pulling this information from a DB for a blog. The problem I'm having is that some of the code isn't showing. For example, in the source code I have this: <pre><code><br /> echo '<ul class="mylist"><li><ul class="left">'; foreach($nameArray as $name) { if($countervar == $half) { echo '</ul></li>'; echo'<li><ul class="right">'; } echo '<li>$name</li>'; ++$i; } echo '</ul></li>'; echo '</ul>'; ?> But all that shows up is this: echo ''; foreach($nameArray as $name) { if($countervar == $half) { echo ''; echo''; } echo '$name'; ++$i; } echo ' An there's some really weird formatting/spacing issues as well. Any ideas as to what is causing this? I should also mention that some of the other sets of code show up just fine.

    Read the article

  • My MYSQL & PHP while code is out of memory, when there is only one row

    - by Sam
    Hey all, why is this code throwing an out of memory error, when there is only 1 row in the database.. $request_db = mysql_query("SELECT * FROM requests WHERE haveplayed='0'") or die(mysql_error()); $request = mysql_fetch_array( $request_db ); echo "<table border=\"1\" align=\"center\">"; while ( $request['haveplayed'] == "0" ) { echo "<tr><td>"; echo $request['SongName']; echo "</td><td>"; echo "<tr><td>"; echo $request['Artist']; echo "</td><td>"; echo "<tr><td>"; echo $request['DedicatedTo']; echo "</td><td>"; } echo "</table>"; Thanks.

    Read the article

  • codeigniter avoiding html div's

    - by rabidmachine9
    Hello there!Is there a proper syntax to avoid div's in codeigniter? I don't really like opening and closing tags all the time... <div class="theForm"> <?php echo form_open('edit/links');//this form uploads echo "Enter the Name: ". form_input('name','name'); echo "Enter the Link: ". form_input('url','url'); echo " ".form_submit('submit', 'Submit'); echo form_close(); if (isset($linksQuery) && count($linksQuery)){ foreach($linksQuery as $link){ echo anchor($link['link'], $link['name'].".", array("class" => "links")); echo form_open('edit/links',array('class' => 'deleteForm')); echo form_hidden('name',$link['name']); echo " ".form_submit('delete','Delete'); echo form_close(); echo br(2); } } ?> </div>

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >