Daily Archives

Articles indexed Wednesday December 19 2012

Page 4/17 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Display custom field if it has content or hide if not

    - by fxg
    I'm display a custom field this way: <div class="blog_text"> <img src="<?php the_field('imagen_prensa'); ?>" /> </div> I would like to make the img appear only if the user has uploaded an image, because right now if there is no image appear the symbol of broken image. I have tried with this but it doesn't work: <?php if (get_field('imagen_prensa') != ''): ?> <img src="<?php the_field('imagen_prensa'); ?>" /> <?php endif; ?> Any idea on the way to achieve it?

    Read the article

  • EKCalendar not added to iCal

    - by Alex75
    I have a strange behavior on my iPhone. I'm creating an application that uses calendar events (EventKit). The class that use is as follows: the .h one #import "GenericManager.h" #import <EventKit/EventKit.h> #define oneDay 60*60*24 #define oneHour 60*60 @protocol CalendarManagerDelegate; @interface CalendarManager : GenericManager /* * metodo che aggiunge un evento ad un calendario di nome Name nel giorno onDate. * L'evento da aggiungere viene recuperato tramite il dataSource che è quindi * OBBLIGATORIO (!= nil). * * Restituisce YES solo se il delegate è conforme al protocollo CalendarManagerDataSource. * NO altrimenti */ + (BOOL) addEventForCalendarWithName:(NSString *) name fromDate:(NSDate *)fromDate toDate: (NSDate *) toDate withDelegate:(id<CalendarManagerDelegate>) delegate; /* * metodo che aggiunge un evento per giorno compreso tra fromDate e toDate ad un * calendario di nome Name. L'evento da aggiungere viene recuperato tramite il dataSource * che è quindi OBBLIGATORIO (!= nil). * * Restituisce YES solo se il delegate è conforme al protocollo CalendarManagerDataSource. * NO altrimenti */ + (BOOL) addEventsForCalendarWithName:(NSString *) name fromDate:(NSDate *)fromDate toDate: (NSDate *) toDate withDelegate:(id<CalendarManagerDelegate>) delegate; @end @protocol CalendarManagerDelegate <NSObject> // viene inviato quando il calendario necessita informazioni sull' evento da aggiungere - (void) calendarManagerDidCreateEvent:(EKEvent *) event; @end the .m one // // CalendarManager.m // AppCampeggioSingolo // // Created by CreatiWeb Srl on 12/17/12. // Copyright (c) 2012 CreatiWeb Srl. All rights reserved. // #import "CalendarManager.h" #import "Commons.h" #import <objc/message.h> @interface CalendarManager () @end @implementation CalendarManager + (void)requestToEventStore:(EKEventStore *)eventStore delegate:(id)delegate fromDate:(NSDate *)fromDate toDate: (NSDate *) toDate name:(NSString *)name { if([eventStore respondsToSelector:@selector(requestAccessToEntityType:completion:)]) { // ios >= 6.0 [eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) { if (granted) { [self addEventForCalendarWithName:name fromDate: fromDate toDate: toDate inEventStore:eventStore withDelegate:delegate]; } else { } }]; } else if (class_getClassMethod([EKCalendar class], @selector(calendarIdentifier)) != nil) { // ios >= 5.0 && ios < 6.0 [self addEventForCalendarWithName:name fromDate:fromDate toDate:toDate inEventStore:eventStore withDelegate:delegate]; } else { // ios < 5.0 EKCalendar *myCalendar = [eventStore defaultCalendarForNewEvents]; EKEvent *event = [self generateEventForCalendar:myCalendar fromDate: fromDate toDate: toDate inEventStore:eventStore withDelegate:delegate]; [eventStore saveEvent:event span:EKSpanThisEvent error:nil]; } } /* * metodo che recupera l'identificativo del calendario associato all'app o nil se non è mai stato creato. */ + (NSString *) identifierForCalendarName: (NSString *) name { NSString * confFileName = [self pathForFile:kCurrentCalendarFileName]; NSDictionary *confCalendar = [NSDictionary dictionaryWithContentsOfFile:confFileName]; NSString *currentIdentifier = [confCalendar objectForKey:name]; return currentIdentifier; } /* * memorizza l'identifier del calendario */ + (void) saveCalendarIdentifier:(NSString *) identifier andName: (NSString *) name { if (identifier != nil) { NSString * confFileName = [self pathForFile:kCurrentCalendarFileName]; NSMutableDictionary *confCalendar = [NSMutableDictionary dictionaryWithContentsOfFile:confFileName]; if (confCalendar == nil) { confCalendar = [NSMutableDictionary dictionaryWithCapacity:1]; } [confCalendar setObject:identifier forKey:name]; [confCalendar writeToFile:confFileName atomically:YES]; } } + (EKCalendar *)getCalendarWithName:(NSString *)name inEventStore:(EKEventStore *)eventStore withLocalSource: (EKSource *)localSource forceCreation:(BOOL) force { EKCalendar *myCalendar; NSString *identifier = [self identifierForCalendarName:name]; if (force || identifier == nil) { NSLog(@"create new calendar"); if (class_getClassMethod([EKCalendar class], @selector(calendarForEntityType:eventStore:)) != nil) { // da ios 6.0 in avanti myCalendar = [EKCalendar calendarForEntityType:EKEntityTypeEvent eventStore:eventStore]; } else { myCalendar = [EKCalendar calendarWithEventStore:eventStore]; } myCalendar.title = name; myCalendar.source = localSource; NSError *error = nil; BOOL result = [eventStore saveCalendar:myCalendar commit:YES error:&error]; if (result) { NSLog(@"Saved calendar %@ to event store. %@",myCalendar,eventStore); } else { NSLog(@"Error saving calendar: %@.", error); } [self saveCalendarIdentifier:myCalendar.calendarIdentifier andName:name]; } // You can also configure properties like the calendar color etc. The important part is to store the identifier for later use. On the other hand if you already have the identifier, you can just fetch the calendar: else { myCalendar = [eventStore calendarWithIdentifier:identifier]; NSLog(@"fetch an old-one = %@",myCalendar); } return myCalendar; } + (EKCalendar *)addEventForCalendarWithName: (NSString *) name fromDate:(NSDate *)fromDate toDate: (NSDate *) toDate inEventStore:(EKEventStore *)eventStore withDelegate: (id<CalendarManagerDelegate>) delegate { // da ios 5.0 in avanti EKCalendar *myCalendar; EKSource *localSource = nil; for (EKSource *source in eventStore.sources) { if (source.sourceType == EKSourceTypeLocal) { localSource = source; break; } } @synchronized(self) { myCalendar = [self getCalendarWithName:name inEventStore:eventStore withLocalSource:localSource forceCreation:NO]; if (myCalendar == nil) myCalendar = [self getCalendarWithName:name inEventStore:eventStore withLocalSource:localSource forceCreation:YES]; NSLog(@"End synchronized block %@",myCalendar); } EKEvent *event = [self generateEventForCalendar:myCalendar fromDate:fromDate toDate:toDate inEventStore:eventStore withDelegate:delegate]; [eventStore saveEvent:event span:EKSpanThisEvent error:nil]; return myCalendar; } + (EKEvent *) generateEventForCalendar: (EKCalendar *) calendar fromDate:(NSDate *)fromDate toDate: (NSDate *) toDate inEventStore:(EKEventStore *) eventStore withDelegate:(id<CalendarManagerDelegate>) delegate { EKEvent *event = [EKEvent eventWithEventStore:eventStore]; event.startDate=fromDate; event.endDate=toDate; [delegate calendarManagerDidCreateEvent:event]; [event setCalendar:calendar]; // ricerca dell'evento nel calendario, se ne trovo uno uguale non lo inserisco NSPredicate *predicate = [eventStore predicateForEventsWithStartDate:fromDate endDate:toDate calendars:[NSArray arrayWithObject:calendar]]; NSArray *matchEvents = [eventStore eventsMatchingPredicate:predicate]; if ([matchEvents count] > 0) { // ne ho trovati di gia' presenti, vediamo se uno e' quello che vogliamo inserire BOOL found = NO; for (EKEvent *fetchEvent in matchEvents) { if ([fetchEvent.title isEqualToString:event.title] && [fetchEvent.notes isEqualToString:event.notes]) { found = YES; break; } } if (found) { // esiste già e quindi non lo inserisco NSLog(@"OH NOOOOOO!!"); event = nil; } } return event; } #pragma mark - Public Methods + (BOOL) addEventForCalendarWithName:(NSString *) name fromDate:(NSDate *)fromDate toDate: (NSDate *) toDate withDelegate:(id<CalendarManagerDelegate>) delegate { BOOL retVal = YES; EKEventStore *eventStore=[[EKEventStore alloc] init]; if ([delegate conformsToProtocol:@protocol(CalendarManagerDelegate)]) { [self requestToEventStore:eventStore delegate:delegate fromDate:fromDate toDate: toDate name:name]; } else { retVal = NO; } return retVal; } + (BOOL) addEventsForCalendarWithName:(NSString *) name fromDate:(NSDate *)fromDate toDate: (NSDate *) toDate withDelegate:(id<CalendarManagerDelegate>) delegate { BOOL retVal = YES; NSDate *dateCursor = fromDate; EKEventStore *eventStore=[[EKEventStore alloc] init]; if ([delegate conformsToProtocol:@protocol(CalendarManagerDelegate)]) { while (retVal && ([dateCursor compare:toDate] == NSOrderedAscending)) { NSDate *finish = [dateCursor dateByAddingTimeInterval:oneDay]; [self requestToEventStore:eventStore delegate:delegate fromDate: dateCursor toDate: finish name:name]; dateCursor = [dateCursor dateByAddingTimeInterval:oneDay]; } } else { retVal = NO; } return retVal; } @end In practice, on my iphone I get the log: fetch an old-one = (null) 19/12/2012 11:33:09.520 AppCampeggioSingolo [730:8 b1b] create new calendar 19/12/2012 11:33:09.558 AppCampeggioSingolo [730:8 b1b] Saved calendar EKCalendar every time I add an event, then I look and I can not find it on iCal calendar event he added. On the iPhone of a friend of mine, however, everything is working correctly. I doubt that the problem stems from the code, but just do not understand what it could be. I searched all day yesterday and part of today on google but have not found anything yet. Any help will be greatly appreciated EDIT: I forgot the call wich is [CalendarManager addEventForCalendarWithName: @"myCalendar" fromDate:fromDate toDate: toDate withDelegate:self]; in the delegate method simply set title and notes of the event like this - (void) calendarManagerDidCreateEvent:(EKEvent *) event { event.title = @"the title"; event.notes = @"some notes"; }

    Read the article

  • updating a properties file in a web application

    - by AmiraGL
    i have a properties file (under rsources folder) in which i'm stocking a variable (key=value), i need to update it when a user insert a new value or update the older one , so can i do it ? i have doubts because it's a web application so it' simply a war deployed in the server so how it is possible to access the .properties file and change it directly from the code . if it's not possible is there another solution ? Any Help will be apprecited Many thanks

    Read the article

  • ImageView doesn't rescale Image to selected size

    - by Buni
    I'm using a ImageView with a fixed size for adding an icon to a menu. In my application, I use it a lot of times, but on this ImageView the Layout Params seem to not work. Unlike the others ImageViews, in this case, I'm using a template directly, but I think that's not the problem. <?xml version="1.0" encoding="utf-8"?> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="1dp" android:layout_height="1dp" android:scaleType="fitCenter" android:src="@drawable/ic_menu_moreoverflow_normal_holo_dark" android:contentDescription="ICON" /> Its been used in code as follows. ImageView iview =(ImageView) View.inflate(context, R.layout.icon, null); Theoretically, It should resize automatically the image, however, the images continues with the original size, although the size was 1dp. Where is the problem? Thanks a lot!

    Read the article

  • Why does this C program compile?

    - by AdmiralJonB
    I've just come across someone's C code that I'm confused as to why it is compiling. There are two points I don't understand. First, the function prototype has no parameters compared to the actual function definition. Secondly, the parameter in the function definition doesn't have an type. #include <stdio.h> int func(); int func(param) { return param; } int main() { int bla = func(10); printf("%d",bla); } Could someone please explain to me why this works? I've tested it in a couple of compilers and it works fine.

    Read the article

  • WPF DataGridTextColumn Can't type point for float data

    - by Alvin
    I had a WPF DataGrid and use DataGridTextColumn Binding to a Collection. The items in Collection had some float property. When my program launched, I modify the value of float property in DataGrid, if I type a integer value, it works well. But if I type char . for a float value, char . can't be typed. I had to type all the numbers first, and then jump to the . position to type char . to finish my input. So how can I type . in my situation? Thanks.

    Read the article

  • Check if CSS Class exists in StyleSheet using javascript/jQuery

    - by Akhil Sekharan
    Is there a way to check if there is a class named 'some-class-name' in css? For example, I have: <style type="text/css"> .box { position: absolute; left: 150%; } </style> My intention is to randomly assign a class to a div on certain event: var classList = []; //Need to populate this array $('#updateClass').on('click', function() { $('#resultDiv').attr('class',classList[Math.floor((Math.random()*classList.length)+1)]); }); Is it possible to check by JS/jQuery whether a class named 'box' exists in the stylesheet? Thanks.

    Read the article

  • zend form check record no exists in database

    - by Yafa Su
    I have a form that check if email exists in the database within 2 tables. I'm using Zend_Validate_Db_NoRecordExists for both validate, but it only check the second one. Any idea why it's not working? class Application_Form_ReferUser extends Zend_Form { public $email, $freeDownload, $buyNow; public function init() { $this->setName('referUser'); $EmailExists = new Zend_Validate_Db_NoRecordExists( array( 'table' => 'referrals', 'field' => 'email' ) ); $EmailExists2 = new Zend_Validate_Db_NoRecordExists( array( 'table' => 'users', 'field' => 'email' ) ); $EmailExists->setMessage('This e-mail is already taken'); $EmailExists2->setMessage('This e-mail is already taken'); $this->email = $this->createElement('text', 'email') ->setLabel('Email') ->addValidator($EmailExists) ->addValidator($EmailExists2) ->addValidator('EmailAddress') ->setRequired(true); $this->freeDownload = $this->createElement('button', 'btn_free_download') ->setLabel('Free Download') ->setAttrib('type', 'submit'); $this->buyNow = $this->createElement('button', 'btn_buy_now') ->setLabel('Buy Now') ->setAttrib('type', 'submit'); $this->addElements(array($this->email, $this->freeDownload, $this->buyNow)); $elementDecorators = array( 'ViewHelper' ); $this->setElementDecorators($elementDecorators); } }

    Read the article

  • Trouble installing R-2.15.2 on Fedora 14

    - by user1896007
    I need to install R-2.15.2, the latest version. I tried using blah> sudo yum install R to install R, but for whatever reason (maybe because it's an old version of Fedora?) my system thinks R version 13 is the most recent. So, I downloaded the .tar.gz file from R's site and used the following: blah> tar -xvf R-2.15.2.tar.gz This successfully unzipped the file. I then ran: blah> ./configure blah/R-2.15.2> ls ChangeLog COPYING Makeconf.in ONEWS src VERSION-NICK config.log doc Makefile.fw OONEWS SVN-REVISION config.site etc Makefile.in po tests configure INSTALL NEWS README tools configure.ac m4 NEWS.pdf share VERSION As you can see, makefiles are present. However, when I run "make" within the R folder, I get the following error: blah/R-2.15.2> make make: No targets specified and no makefile found. Stop. Is there any way I can fix this issue? I'm guessing people will recommend updating Fedora, but is there another way?

    Read the article

  • How to show useful error messages from a database error callback in Phonegap?

    - by Magnus Smith
    Using Phonegap you can set a function to be called back if the whole database transaction or the individual SQL statement errors. I'd like to know how to get more information about the error. I have one generic error-handling function, and lots of different SELECTs or INSERTs that may trigger it. How can I tell which one was at fault? It is not always obvious from the error message. My code so far is... function get_rows(tx) { tx.executeSql("SELECT * FROM Blah", [], lovely_success, statement_error); } function add_row(tx) { tx.executeSql("INSERT INTO Blah (1, 2, 3)", [], carry_on, statement_error); } function statement_error(tx, error) { alert(error.code + ' / ' + error.message); } From various examples I see the error callback will be passed a transaction object and an error object. I read that .code can have the following values: UNKNOWN_ERR = 0 DATABASE_ERR = 1 VERSION_ERR = 2 TOO_LARGE_ERR = 3 QUOTA_ERR = 4 SYNTAX_ERR = 5 CONSTRAINT_ERR = 6 TIMEOUT_ERR = 7 Are there any other properties/methods of the error object? What are the properties/methods of the transaction object at this point? I can't seem to find a good online reference for this. Certainly not on the Phonegap website!

    Read the article

  • "No XML content. Please add a root view or layout to your document."

    - by ez4nick
    I am trying to follow this tutorial : http://developer.android.com/training/basics/firstapp/building-ui.html as I am new to android developing and this is what my "activity_main.xml" file looks like : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal"> <EditText android:id="@+id/edit_message" android:layout_weight="1" android:layout_width="0dp" android:layout_height="wrap_content" android:hint="@string/edit_message" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/button_send" /> When I click run I get an error that says "No XML content. Please add a root view or layout to your document." and I noticed there is a new file generated called "activity_main.out.xml". What could I be doing wrong?

    Read the article

  • Several border firewalls in the same network

    - by nimai
    I'm currently analyzing the consequences of multipath connections for the firewalls. In that context, I'm wondering if it's really uncommon to have several firewalls at the borders of a network to protect it. The typical case I'd imagine would be a multihomed network, for which the administrator would have different policies for links from different (or not) ISPs. Or maybe even in an ISP's network. What would be the practical (dis)advantages of such a configuration? Could you provide an example of an existing topology using several border firewalls?

    Read the article

  • Server freeze restarted quickly so how do I fiond what went wrong?

    - by Charlie
    I have a SQL SERVER DB running on a windows server 2008 (VMWare) Yesterday I could not RDP to it so I ended some RDP sessions which were left logged in. This seemed to solve the problem. However last night I learned that the DB was inaccessible and unresponsive to customers. My colleague checked the server but again is unable to create an RDP connection. He then restarted the server and since it has been fine. Looking at the CPU Readings of the Server it spiked up to 100% before the original RDP problem .After I ended the extra seeions uit again dropped down to normal levels however before the time of the customer complaint it had rose to 100% again - before it had to be restarted. Is there anyway I can investigate which processes may have caused the problem in the first place. Would there be some kind of memory dump from when it was restarted. I would prefer to find out what is wrong now instead of waiting until it happens again.

    Read the article

  • does heartbeat v3 support same resource agent types of pacemaker?

    - by Emre He
    As we know, Pacemaker supports three types of Resource Agents, ? LSB Resource Agents, ? OCF Resource Agents, ? legacy Heartbeat Resource Agents http://www.linux-ha.org/wiki/Resource_Agents does heartbeat v3 support above 3 types resource agent? or it only support LSB and legacy heartbeat resource agents? because we have only virtual ip and one service need to switch in ha cluster, so we decide not involve pacemaker, so we come to this question, for example we cannot monitor the application service by heartbeat, heartbeat only can handle to start it on active node. thanks, Emre

    Read the article

  • HyperV management through Windows 8

    - by Snake
    Consider the following setup: 1 Hypervisor 3 Clients (Server 2012 with AD, Server 2012, Windows 8). Now we can remote desktop into the Hypervisor and manage the VMs with the manager. This also works from the Server 2012 (I installed the manager there). But it doesn't work from the Windows 8 machine. All machines are in the same domain. Am I forgetting something? I followed this long page http://technet.microsoft.com/en-us/library/cc794756(v=ws.10).aspx But I find it so weird that it works for the same user on Windows Server 2012, but not on Windows 8.

    Read the article

  • No outbound internet connection after restarting CentOS 6.3

    - by wnstnsmth
    After restarting a headless CentOS 6.3 machine, it lost outbound internet connectivity, i.e. I can still connect to the server via SSH (ssh root@**.126.18.56), but stuff such as ping google.com gives google.com: unknown host, and yum list some_package gives a lot of network errors. This is what ifconfig gives: eth0 Link encap:Ethernet HWaddr 00:25:90:78:2D:5D inet addr:**.126.18.56 Bcast:**.126.18.255 Mask:255.255.255.0 inet6 addr: fe80::225:90ff:fe78:2d5d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:75594 errors:0 dropped:0 overruns:0 frame:0 TX packets:787 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:7074741 (6.7 MiB) TX bytes:144391 (141.0 KiB) Interrupt:20 Memory:f7a00000-f7a20000 eth1 Link encap:Ethernet HWaddr 00:25:90:78:2D:5C UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) Interrupt:16 Memory:f7900000-f7920000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:6 errors:0 dropped:0 overruns:0 frame:0 TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:504 (504.0 b) TX bytes:504 (504.0 b) I have absolutely no clue how to debug this, and I find it very strange since I can still connect via ssh. EDIT: Weirdly, /etc/resolv.conf does not contain any entries, or none that I can make sense of: # Generated by NetworkManager search sui-inter.net # No nameservers found; try putting DNS servers into your # ifcfg files in /etc/sysconfig/network-scripts like so: # # DNS1=xxx.xxx.xxx.xxx # DNS2=xxx.xxx.xxx.xxx # DOMAIN=lab.foo.com bar.foo.com So is it possible that rebooting the server erased that file? It worked before at least! And how do I solve this? By the way, pinging an IP address works.

    Read the article

  • Apache fails silently after installation of MapServer 6.2.0

    - by wnstnsmth
    I've recently compiled MapServer 6.2 on a CentOS 6.3 machine, using ./configure --with-ogr=/usr/bin/gdal-config --with-gdal=/usr/bin/gdal-config --with-proj=/usr --with-geos=/usr/bin/geos-config --with-postgis=/usr/bin/pg_config --with-php=/usr/include/php --with-wfs --with-wfsclient --with-wmsclient --enable-debug --with-threads --with-wcs --with-sos --with-gd --with-freetype=/usr/bin --with-jpeg --with-cairo --with-curl if that is of interest, anyway. So after that, Apache/2.2.15 silently fails to restart, i.e. when apachectl graceful, it says "httpd not running, trying to start". There is nothing of interest in the Apache errors_log, /var/log/messages, and it is weird because so far it has always worked. Restarting the machine multiple times did not solve the problem. Some other stuff I did: [root@R12X0210 cgi-bin]# service httpd status httpd is stopped [root@R12X0210 cgi-bin]# ps aux|grep httpd root 1846 0.0 0.0 103236 864 pts/0 S+ 12:11 0:00 grep httpd I suspect this might have something to do with a php module that was altered/added by MapServer, but I don't really know... I don't even know how to properly debug this.

    Read the article

  • IIS slow response

    - by Martin Ševic
    I have developed ASP.NET 4.5 application which take infos about sensors from sqlite database every 3 seconds. This application runs nice on my local develop machine on IIS Express server. I have created virtual machine (4x 3,25 GHz CPU; 6GB RAM) where i have installed Windows Server 2012 and IIS 8 service in order to test application on real server because we will run it on production machine later. After installing VC++ 2010 x64 and VC++ 2010 x86 and set "Enable 32-bit application" to true in application pool website started to work but there is a large problem with response time. There is a for example 10 seconds delay before page loads. CPU utillization is about 10% and RAM about 1,5GB. I am new to configuring IIS server so i want to ask if there is some tip how to make it faster. I am sure, there will be some twist which will make it normal work. Many thanks.

    Read the article

  • Enabling http access on port 80 for centos 6.3 from console

    - by Hugo
    Have a centos 6.3 box running on Parallels and I'm trying to open port 80 to be accesible from outside tried the gui solution from this post and it works, but I need to get it done from a script. Tried to do this: sudo /sbin/iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT sudo /sbin/iptables-save sudo /sbin/service iptables restart This creates exactly the same iptables entries as the GUI tool except it does not work: $ telnet xx.xxx.xx.xx 80 Trying xx.xxx.xx.xx... telnet: connect to address xx.xxx.xx.xx: Connection refused telnet: Unable to connect to remote host UPDATE: $ netstat -ntlp (No info could be read for "-p": geteuid()=500 but you should be root.) Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:37439 0.0.0.0:* LISTEN - tcp 0 0 :::111 :::* LISTEN - tcp 0 0 :::22 :::* LISTEN - tcp 0 0 ::1:631 :::* LISTEN - tcp 0 0 :::60472 :::* LISTEN - $ sudo cat /etc/sysconfig/iptables # Generated by iptables-save v1.4.7 on Wed Dec 12 18:04:25 2012 *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [5:640] -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT # Completed on Wed Dec 12 18:04:25 2012

    Read the article

  • difference between compiled and installed via rpm (zypper)

    - by cherouvim
    In an openSUSE 11.1 I download, compile and install ImageMagick via: wget ftp://.../pub/graphics/ImageMagick/ImageMagick-6.7.7-0.zip unzip ImageMagick-6.7.7-0.zip cd ImageMagick-6.7.7-0 ./configure --prefix=/usr/local/ImageMagick make make install Everything works nicelly until I discover that JPG is not supported: identify -list format | grep -i jpg [nothing related to JPG returned] So I reconfigure and recompile using: ./configure --prefix=/usr/local/ImageMagick --with-jpeg=yes --with-jp2=yes make make install But that changes nothing. I end up uninstalling: make uninstall and installing via zypper: zypper install ImageMagick This installed version 6.4.3 and now it does support JPG: identify -list format | grep -i jpg JPG* JPEG rw- Joint Photographic Experts Group JFIF format Any idea on what is going on here? What is a possible reason that this capability of ImageMagick was not there when compiled from source but was there when installed from rpm? Note that I don't necessarily care a lot about ImageMagick (since it now works), but generally about his kind of behaviour, becase in one way or another I've seen this happen in other ocasions as well.

    Read the article

  • /etc/rc.local doesn't execute apache tomcat startup script on boot

    - by user119720
    I'm having some problem with my centOS machine.I want to insert a line inside the rc.local to execute apache tomcat on startup. Below are the configuration for /etc/rc.local #!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch /var/lock/subsys/local /opt/apache-jakarta/bin/startup.sh Unfortunately,the apache tomcat does not start on the boot time. I've already execute the script manually and it is working without any issues. Is there any specific syntax to put script inside the rc.local?Or did I forgetting something?Please Advice.Thanks. EDIT: My boot.log only show this output: Dec 17 21:04:53 localhost NET[2969]: /sbin/dhclient-script : updated /etc/resolv.conf

    Read the article

  • Increasing SQL Server / Sage performance with SSD? (Dell PE T410)

    - by Anthony
    I have a client wanting better performance of their Sage (Accpac & CRM) server (v5.5, soon to be v7). It's running on 1 of 2 Hyper-V VMs (Svr2008) on a Dell PE T410 server with 24GB of RAM (1333MHz) & dual quad-core, and both VMs (only their C: drives) are on a single RAID5 array. All clients connect via 1Gb ethernet. The 2nd VM is SBS2008 with 9GB RAM (& all SBS dbs & company data are on a separate RAID5 array), & 3GB RAM for the Svr2008 hypervisor. I've given the Sage/SQL Server VM all the RAM I can (12GB) & SQL Server RAM caching (~8GB, never exceeds ~7.5GB, eg. entire db can now be cached in RAM) and that's helped significantly. Upgrading the Hypervisor to Svr2012 is an obvious step, but probably not a dramatic improvement? What about an SSD for this Sage/SQL Server VM (VM = 100GB, <10GB for the actual live DB) ? Can SSDs be put into the SAS hot-swap bays? Or will I have to use the mobo SATA(3Gbps?) ports, or PCI-E SSD card? Should SSDs be RAIDed for this situation? Or is SSD's higher reliability offsetting the need for RAID1/5/10? (I have nightly full disk backups) New territory for me, would appreciate some feedback. Thanks, Anthony.

    Read the article

  • Why can't SVN checkout into a virtualbox shared folder?

    - by Alex Waters
    I am trying to checkout into the virtualbox shared folder with svn 1.7 in ubuntu 12.04 running as a guest on a windows 7 host. I had read that this error was a 1.6 problem, and updated - but am still receiving the error: svn: E000071: Can't move '/mnt/hostShare/code/www/.svn/tmp/svn-hsOG5X' to '/mnt/hostShare/code/www/trunk/statement.aspx?d=201108': Protocol error I found this blog post about the same error in a mac environment, but am finding that changing the folder/file permissions does nothing. vim .svn/entires just has the number 12 - does this need to be changed? Thank you for any assistance! (just another reason for why I prefer git...)

    Read the article

  • rsync without password, none of google (server fault) tutorials worked

    - by Jake Armstrong
    I need to use rsync for a daily backup operation and in the past (on different servers) I managed to just use a rsa key etc, but now none of google (serverfault) tutorials work at all. It keeps asking me for a password. I have webmin and ssh/root access to both servers. My steps: create a key on server 1 send key.pub to server 2 add key.pub to .ssh/authorized_keys chmod 700 .ssh/authorized_keys go back to server 1 and try rsync and it keep asking for password... rsync command: rsync -avz -e ssh file.txt root@server2:/root EDIT: well, I cleaned up everything and this time, instead of inserting a custom name to the key I used the standard one on server1. sent the .pub to server2 and it worked as a charm... So the answer is that server1's ssh wasn't even using the right key...

    Read the article

  • recipient_delimiter in MS-Exchange

    - by guettli
    Most UNIX mail server support recipient delimiters behind a plus sign in email addresses. [email protected] In the above example "everything" could be any string, and the mail should get into the mail box of the user "user". In postfix it is called recipient_delimiter: http://www.postfix.org/postconf.5.html#recipient_delimiter Is this possible with Exchange 2010? Usecase1: The user can use different email addresses. He can use [email protected] for the communication with "fooshop". If he gets spam mail to this address later, he knows that fooshop has given his address to someone else. Usecase2: We run a ticket system ( http://tbz-pariv.de/software/modwork/ ) and want to add send scans via email to the system. The network scanner can only modify the to-address and we want to insert the ticket type like this [email protected]

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >