Search Results

Search found 5260 results on 211 pages for 'fedora 17'.

Page 8/211 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • How to stop a random ramp in FCGI Processes Killing the server

    - by Andy Main
    So got the below earlier to day... Around that time the logs show a ramp in processes(600) and associated memory (1.2g), cpu usage load average (80) untill the server gave out. Server had to be hard reset by host as there was no ssh or plesk panel access. Fast CGI is configured as below and is setup for one high use site. As I understand it FcgidMaxProcesses 20 should protect against what happen but has not. I've read many forums with differing answers and references to many different fcgi directives, but have found nothing conclusive. Any one got some definitive answers on how to stop this sort of server process ramping and subsequent server failure? If you need more info let me know. Cheers Andy  /var/log/apache2/error_log [Thu May 17 07:40:47 2012] [warn] mod_fcgid: process 17651 graceful kill fail, sending SIGKILL [Thu May 17 07:40:47 2012] [warn] mod_fcgid: process 17650 graceful kill fail, sending SIGKILL [Thu May 17 07:40:47 2012] [warn] mod_fcgid: process 17649 graceful kill fail, sending SIGKILL [Thu May 17 07:40:47 2012] [warn] mod_fcgid: process 17644 graceful kill fail, sending SIGKILL [Thu May 17 07:40:47 2012] [warn] mod_fcgid: process 17643 graceful kill fail, sending SIGKILL [Thu May 17 07:40:47 2012] [warn] mod_fcgid: process 17638 graceful kill fail, sending SIGKILL [Thu May 17 07:40:47 2012] [warn] mod_fcgid: process 17633 graceful kill fail, sending SIGKILL [Thu May 17 07:40:47 2012] [warn] mod_fcgid: process 17627 graceful kill fail, sending SIGKILL [Thu May 17 07:40:47 2012] [warn] mod_fcgid: process 17622 graceful kill fail, sending SIGKILL [Thu May 17 07:40:51 2012] [warn] mod_fcgid: process 17674 graceful kill fail, sending SIGKILL [Thu May 17 07:40:51 2012] [warn] mod_fcgid: process 17673 graceful kill fail, sending SIGKILL [Thu May 17 07:40:51 2012] [warn] mod_fcgid: process 17672 graceful kill fail, sending SIGKILL [Thu May 17 07:40:51 2012] [warn] mod_fcgid: process 17667 graceful kill fail, sending SIGKILL [Thu May 17 07:40:51 2012] [warn] mod_fcgid: process 17666 graceful kill fail, sending SIGKILL [Thu May 17 07:40:51 2012] [warn] mod_fcgid: process 17665 graceful kill fail, sending SIGKILL [Thu May 17 07:40:51 2012] [warn] mod_fcgid: process 17664 graceful kill fail, sending SIGKILL [Thu May 17 07:40:51 2012] [warn] mod_fcgid: process 17659 graceful kill fail, sending SIGKILL [Thu May 17 07:40:51 2012] [warn] mod_fcgid: process 17658 graceful kill fail, sending SIGKILL [Thu May 17 07:40:51 2012] [warn] mod_fcgid: process 17657 graceful kill fail, sending SIGKILL [Thu May 17 07:40:51 2012] [warn] mod_fcgid: process 17656 graceful kill fail, sending SIGKILL [Thu May 17 07:40:51 2012] [warn] mod_fcgid: process 17651 graceful kill fail, sending SIGKILL https://docs.google.com/a/thesugarrefinery.com/open?id=0B_XbpWChge0VRmFLWEZfR2VBb2M https://docs.google.com/a/thesugarrefinery.com/open?id=0B_XbpWChge0VWTcwZEhoV2Fqejg https://docs.google.com/a/thesugarrefinery.com/open?id=0B_XbpWChge0VUUtVWWFINHZjZ0U https://docs.google.com/a/thesugarrefinery.com/open?id=0B_XbpWChge0VZEVMclh6ZUdaOUE <IfModule mod_fcgid.c> <IfModule !mod_fastcgi.c> AddHandler fcgid-script fcg fcgi fpl </IfModule> FcgidIPCDir /var/lib/apache2/fcgid/sock FcgidProcessTableFile /var/lib/apache2/fcgid/shm FcgidIdleTimeout 40 FcgidProcessLifeTime 30 FcgidMaxProcesses 20 FcgidMaxProcessesPerClass 20 FcgidMinProcessesPerClass 0 FcgidConnectTimeout 30 FcgidIOTimeout 120 FcgidInitialEnv RAILS_ENV production FcgidIdleScanInterval 10 FcgidMaxRequestLen 1073741824 </IfModule>

    Read the article

  • Window Leaked on FBConnect in Android?

    - by Praveen Chandrasekaran
    how to rectify this Window Leaked Exception. i cant find why its occured. My LogCat Info: 05-07 17:25:05.402: ERROR/WindowManager(13595): Activity com.codecarpet.fbconnect.FBLoginActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@433b9ae0 that was originally added here 05-07 17:25:05.402: ERROR/WindowManager(13595): android.view.WindowLeaked: Activity com.codecarpet.fbconnect.FBLoginActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@433b9ae0 that was originally added here 05-07 17:25:05.402: ERROR/WindowManager(13595): at android.view.ViewRoot.<init>(ViewRoot.java:214) 05-07 17:25:05.402: ERROR/WindowManager(13595): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148) 05-07 17:25:05.402: ERROR/WindowManager(13595): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91) 05-07 17:25:05.402: ERROR/WindowManager(13595): at android.view.Window$LocalWindowManager.addView(Window.java:409) 05-07 17:25:05.402: ERROR/WindowManager(13595): at android.app.Dialog.show(Dialog.java:238) 05-07 17:25:05.402: ERROR/WindowManager(13595): at android.app.ProgressDialog.show(ProgressDialog.java:107) 05-07 17:25:05.402: ERROR/WindowManager(13595): at android.app.ProgressDialog.show(ProgressDialog.java:95) 05-07 17:25:05.402: ERROR/WindowManager(13595): at com.codecarpet.fbconnect.FBProgressDialog.show(FBProgressDialog.java:106) 05-07 17:25:05.402: ERROR/WindowManager(13595): at com.codecarpet.fbconnect.FBDialog$WebViewClientImpl.onPageStarted(FBDialog.java:508) 05-07 17:25:05.402: ERROR/WindowManager(13595): at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:214) 05-07 17:25:05.402: ERROR/WindowManager(13595): at android.os.Handler.dispatchMessage(Handler.java:99) 05-07 17:25:05.402: ERROR/WindowManager(13595): at android.os.Looper.loop(Looper.java:123) 05-07 17:25:05.402: ERROR/WindowManager(13595): at android.app.ActivityThread.main(ActivityThread.java:4203) 05-07 17:25:05.402: ERROR/WindowManager(13595): at java.lang.reflect.Method.invokeNative(Native Method) 05-07 17:25:05.402: ERROR/WindowManager(13595): at java.lang.reflect.Method.invoke(Method.java:521) 05-07 17:25:05.402: ERROR/WindowManager(13595): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 05-07 17:25:05.402: ERROR/WindowManager(13595): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 05-07 17:25:05.402: ERROR/WindowManager(13595): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • possible UDP attack on BIND?

    - by Waleed Hamra
    hello everyone, i was surprised last month when my EC2 instance (ubuntu precise server), that is supposed to be under the free tier still, accumulated lots of traffic... today, while checking my current billing statement, i noticed i already have tons of traffic, while still in the middle of the month, and i'm fearing what my bill by the end of the month is going to be... i installed bandwidthd, and after few minutes, i noticed lots of UDP traffic to "108.162.233.15". this is apparently a cloudflare IP, and i don't have anything using cloudflare (as far as i know). so i ran "iftop" to see what ports are being used, and i saw the UDP traffic coming from port 80 to my port 53... why would a webserver query dns? so i stopped bind on my server, and ran it in foreground debugging mode, and saw the following query, being repeated continuously: 17-Nov-2012 12:30:58.216 client 108.162.233.15#80: UDP request 17-Nov-2012 12:30:58.216 client 108.162.233.15#80: request is not signed 17-Nov-2012 12:30:58.216 client 108.162.233.15#80: recursion available 17-Nov-2012 12:30:58.216 client 108.162.233.15#80: query 17-Nov-2012 12:30:58.216 client 108.162.233.15#80: query (cache) 'isc.org/ANY/IN' approved 17-Nov-2012 12:30:58.216 client 108.162.233.15#80: send 17-Nov-2012 12:30:58.216 client 108.162.233.15#80: sendto 17-Nov-2012 12:30:58.216 client 108.162.233.15#80: senddone 17-Nov-2012 12:30:58.217 client 108.162.233.15#80: next 17-Nov-2012 12:30:58.217 client 108.162.233.15#80: endrequest 17-Nov-2012 12:30:58.217 client @0x7fbee05126e0: udprecv 17-Nov-2012 12:30:58.343 client 108.162.233.15#80: UDP request 17-Nov-2012 12:30:58.343 client 108.162.233.15#80: request is not signed 17-Nov-2012 12:30:58.343 client 108.162.233.15#80: recursion available 17-Nov-2012 12:30:58.343 client 108.162.233.15#80: query 17-Nov-2012 12:30:58.343 client 108.162.233.15#80: query (cache) 'isc.org/ANY/IN' approved 17-Nov-2012 12:30:58.343 client 108.162.233.15#80: send 17-Nov-2012 12:30:58.344 client 108.162.233.15#80: sendto 17-Nov-2012 12:30:58.344 client 108.162.233.15#80: senddone 17-Nov-2012 12:30:58.344 client 108.162.233.15#80: next 17-Nov-2012 12:30:58.344 client 108.162.233.15#80: endrequest my question is... is this normal? should i be worried? or is this completely irrelevant to my data charges, and i should wait to see more data from bandwidthd? thank you in advance.

    Read the article

  • Fedora vs Ubuntu vs Debian to host Subversion and Bugzilla over Apache

    - by Tone
    I'm not interested in a flame war of Ubuntu vs Fedora vs Debian vs whatever. What I am interested in is whether or not I should move my current Ubuntu server to Fedora or Debian. I have been able to get Subversion setup and hosted via Apache over https and it works quite well (I'm a .NET guy so this was all new to me). I'm having trouble though with installing Bugszilla - have run into some issues getting all the perl scripts to run successfully so my questions are: 1) Will Bugszilla will install easier on Fedora or Debian? Can I just install a package instead of having to download the tar.gz file and untar it, run perl scripts, etc. 2) Is Fedora or Debian considered to be a better production server system? I have no desire for a GUI, just need it to host Subversion, Bugzilla over Apache2, and act as a file and print server for my home network.

    Read the article

  • Fedora vs Ubuntu to host Subversion and Bugszilla over Apache

    - by Tone
    I'm not interested in a flame war of Ubuntu vs Fedora vs whatever. What I am interested in is whether or not I should move my current Ubuntu server to Fedora. I have been able to get Subversion setup and hosted via Apache over https and it works quite well (I'm a .NET guy so this was all new to me). I'm having trouble though with installing Bugszilla - have run into some issues getting all the perl scripts to run successfully so my questions are: 1) Will Bugszilla will install easier on Fedora? Can I just install a package instead of having to download the tar.gz file and untar it, run perl scripts, etc. 2) Is Fedora considered to be a better production server system? I have no desire for a GUI, just need it to host Subversion, Bugzilla over Apache2, and act as a file and print server for my home network.

    Read the article

  • Rebuild Fedora 19 ISO adding Kickstart for USB install

    - by dooffas
    I am attempting to edit a Fedora 19 DVD ISO to add a kickstart file. I then need this ISO burnt to a USB stick for instillation. The error I get when booting is Warning: Could not boot. Warning: /dev/root does not exist To try and determine which part of the process is failing I have broken the process down in to separate stages. Step 1: Burn the original ISO "Fedora-19-x86_64-DVD.iso" (Available - here) to a pendrive and see if that will install. dd if=/path/to/iso of=/dev/sdc Burning this image was successful and it installed without issue. Step 2: Exctract the ISO, repackage it and burn it to a pendrive and see if that will install. PLEASE NOTE: The final command in this section has been broken down in to multiple lines for ease of reading, in fact it was run as a single command on one line. mkdir -p /mnt/linux mount -o loop /tmp/linux-install.iso /mnt/linux cd /mnt/ tar -cvf - linux | (cd /var/tmp/ && tar -xf - ) cd /var/tmp/linux xorriso -as mkisofs -R -J -V "NewFedoraImage" -o ouput/file.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -isohybrid-mbr /usr/share/syslinux/isohdpfx.bin . This iso was then burnt to a pendrive as before. dd if=/path/to/iso of=/dev/sdc This ISO burnt to the pen drive with no problem and will boot. I then see the fedora options screen. After choosing either "Install Fedora 19" or "Test this media & install Fedora 19" I then receive the errors highlighted above. This means the kickstart file is not to blame, but repackaging the ISO. Is there something I am missing in the repackaging process? Any input would be great! NOTE: If it is of any help, I attempted Step 2 with an Ubuntu server ISO and the process was successful.

    Read the article

  • Creating syncable Calendar in ICS

    - by user1390816
    I have a problem with creating a new Calendar in ICS. The Calendar should be synyable to the google Calendar. I try following: Uri calendarUri = CalendarContract.Calendars.CONTENT_URI; calendar.put(CalendarContract.Calendars.ACCOUNT_NAME, sync_account); calendar.put(CalendarContract.Calendars.ACCOUNT_TYPE, "com.google"); calendar.put(CalendarContract.Calendars.NAME, name); calendar.put(CalendarContract.Calendars.CALENDAR_DISPLAY_NAME, displayName); calendar.put(CalendarContract.Calendars.CALENDAR_COLOR, 0xFF008080); calendar.put(CalendarContract.Calendars.CALENDAR_ACCESS_LEVEL, CalendarContract.Calendars.CAL_ACCESS_OWNER); calendar.put(CalendarContract.Calendars.OWNER_ACCOUNT, true); calendar.put(CalendarContract.Calendars.VISIBLE, 1); calendar.put(CalendarContract.Calendars.SYNC_EVENTS, 1); calendarUri = calendarUri.buildUpon() .appendQueryParameter(CalendarContract.CALLER_IS_SYNCADAPTER, "true") .appendQueryParameter(CalendarContract.Calendars.ACCOUNT_NAME, sync_account) .appendQueryParameter(CalendarContract.Calendars.ACCOUNT_TYPE, "com.google") // CalendarContract.ACCOUNT_TYPE_LOCAL .build(); Uri result = activity.getContentResolver().insert(calendarUri, calendar); an I get always this error: 09-17 17:11:30.278: E/AndroidRuntime(13243): FATAL EXCEPTION: CalendarSyncAdapterAccountMonitor 09-17 17:11:30.278: E/AndroidRuntime(13243): java.lang.IllegalArgumentException: the name must not be empty: null 09-17 17:11:30.278: E/AndroidRuntime(13243): at android.accounts.Account.<init>(Account.java:48) 09-17 17:11:30.278: E/AndroidRuntime(13243): at com.google.android.syncadapters.calendar.CalendarSyncAdapter.onAccountsUpdated(CalendarSyncAdapter.java:1129) 09-17 17:11:30.278: E/AndroidRuntime(13243): at android.accounts.AccountManager$11.run(AccountManager.java:1279) 09-17 17:11:30.278: E/AndroidRuntime(13243): at android.os.Handler.handleCallback(Handler.java:605) 09-17 17:11:30.278: E/AndroidRuntime(13243): at android.os.Handler.dispatchMessage(Handler.java:92) 09-17 17:11:30.278: E/AndroidRuntime(13243): at android.os.Looper.loop(Looper.java:137) 09-17 17:11:30.278: E/AndroidRuntime(13243): at android.os.HandlerThread.run(HandlerThread.java:60) 09-17 17:11:30.293: E/android.os.Debug(1989): !@Dumpstate > dumpstate -k -t -n -z -d -o /data/log/dumpstate_app_error What can I do with the CalendarSyncAdapterAccountMonitor, that it is not empty? Thanks in advance.

    Read the article

  • Differences between Fedora servers

    - by Yarin
    I'm using Amazon EC2 and trying to choose a machine image (AMI) for my project. It seems all their LAMP AMIs are Fedora Core 4, but this seems like quite an old version, considering the current release is apparently Fedora 12, and < 10 releases are no longer supported. My question is how significantly different are the early fedora releases- is it crazy to be on versions 4 or even 8? (I realize this is probably a broad question)

    Read the article

  • Is Fedora a bad choice for a server?

    - by Jakobud
    I'm taking over IT responsibilities at a small company. Most of the servers appear to be running various releases of Fedora (file servers, backup servers, oracle servers, etc). I don't have much experience with Fedora, but I was under the impression its geared for end user desktops/workstations/laptops. Is Fedora a bad choice for servers?

    Read the article

  • Force close when starting new activity

    - by Alex
    I'm trying to launch a new activity from my main activity, but I just get error codes all the time. Heres my main activity; public class gunstats extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button button4 = (Button)findViewById(R.id.button4); button4.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { Intent intent = new Intent(gunstats.this, more.class); startActivity(intent); } }); } } and the activity that is being called from my main class; public class more extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final MediaPlayer mp = MediaPlayer.create(this, R.raw.deagle); Button buttonm1 = (Button)this.findViewById(R.id.buttonm1); buttonm1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mp.start(); } }); } } And there's nothing wrong in the manifest Heres my logcat: 01-08 16:33:17.647: ERROR/AndroidRuntime(552): Uncaught handler: thread main exiting due to uncaught exception 01-08 16:33:17.676: ERROR/AndroidRuntime(552): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.gunstats/com.gunstats.more}; have you declared this activity in your AndroidManifest.xml? 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1480) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1454) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.app.Activity.startActivityForResult(Activity.java:2660) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.app.Activity.startActivity(Activity.java:2704) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at com.gunstats.gunstats$4.onClick(gunstats.java:64) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.View.performClick(View.java:2344) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.View.onTouchEvent(View.java:4133) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.widget.TextView.onTouchEvent(TextView.java:6504) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.View.dispatchTouchEvent(View.java:3672) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1712) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1202) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.app.Activity.dispatchTouchEvent(Activity.java:1987) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1696) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.ViewRoot.handleMessage(ViewRoot.java:1658) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.os.Handler.dispatchMessage(Handler.java:99) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.os.Looper.loop(Looper.java:123) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.app.ActivityThread.main(ActivityThread.java:4203) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at java.lang.reflect.Method.invokeNative(Native Method) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at java.lang.reflect.Method.invoke(Method.java:521) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at dalvik.system.NativeStart.main(Native Method) What is causing this force close?

    Read the article

  • How to optimize dynamic programming?

    - by Chan
    Problem A number is called lucky if the sum of its digits, as well as the sum of the squares of its digits is a prime number. How many numbers between A and B are lucky? Input: The first line contains the number of test cases T. Each of the next T lines contains two integers, A and B. Output: Output T lines, one for each case containing the required answer for the corresponding case. Constraints: 1 <= T <= 10000 1 <= A <= B <= 10^18 Sample Input: 2 1 20 120 130 Sample Output: 4 1 Explanation: For the first case, the lucky numbers are 11, 12, 14, 16. For the second case, the only lucky number is 120. The problem is quite simple if we use brute force, however the running time is so critical that my program failed most test cases. My current idea is to use dynamic programming by storing the previous sum in a temporary array, so for example: sum_digits(10) = 1 -> sum_digits(11) = sum_digits(10) + 1 The same idea is applied for sum square but with counter equals to odd numbers. Unfortunately, it still failed 9 of 10 test cases which makes me think there must be a better way to solve it. Any idea would be greatly appreciated. #include <iostream> #include <vector> #include <string> #include <algorithm> #include <unordered_map> #include <unordered_set> #include <cmath> #include <cassert> #include <bitset> using namespace std; bool prime_table[1540] = { 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 }; unsigned num_digits(long long i) { return i > 0 ? (long) log10 ((double) i) + 1 : 1; } void get_sum_and_sum_square_digits(long long n, int& sum, int& sum_square) { sum = 0; sum_square = 0; int digit; while (n) { digit = n % 10; sum += digit; sum_square += digit * digit; n /= 10; } } void init_digits(long long n, long long previous_sum[], const int size = 18) { int current_no_digits = num_digits(n); int digit; for (int i = 0; i < current_no_digits; ++i) { digit = n % 10; previous_sum[i] = digit; n /= 10; } for (int i = current_no_digits; i <= size; ++i) { previous_sum[i] = 0; } } void display_previous(long long previous[]) { for (int i = 0; i < 18; ++i) { cout << previous[i] << ","; } } int count_lucky_number(long long A, long long B) { long long n = A; long long end = B; int sum = 0; int sum_square = 0; int lucky_counter = 0; get_sum_and_sum_square_digits(n, sum, sum_square); long long sum_counter = sum; long long sum_square_counter = sum_square; if (prime_table[sum_counter] && prime_table[sum_square_counter]) { lucky_counter++; } long long previous_sum[19] = {1}; init_digits(n, previous_sum); while (n < end) { n++; if (n % 100000000000000000 == 0) { previous_sum[17]++; sum_counter = previous_sum[17] + previous_sum[18]; sum_square_counter = previous_sum[17] * previous_sum[17] + previous_sum[18] * previous_sum[18]; previous_sum[16] = 0; previous_sum[15] = 0; previous_sum[14] = 0; previous_sum[13] = 0; previous_sum[12] = 0; previous_sum[11] = 0; previous_sum[10] = 0; previous_sum[9] = 0; previous_sum[8] = 0; previous_sum[7] = 0; previous_sum[6] = 0; previous_sum[5] = 0; previous_sum[4] = 0; previous_sum[3] = 0; previous_sum[2] = 0; previous_sum[1] = 0; previous_sum[0] = 0; } else if (n % 10000000000000000 == 0) { previous_sum[16]++; sum_counter = previous_sum[16] + previous_sum[17] + previous_sum[18]; sum_square_counter = previous_sum[16] * previous_sum[16] + previous_sum[17] * previous_sum[17] + previous_sum[18] * previous_sum[18]; previous_sum[15] = 0; previous_sum[14] = 0; previous_sum[13] = 0; previous_sum[12] = 0; previous_sum[11] = 0; previous_sum[10] = 0; previous_sum[9] = 0; previous_sum[8] = 0; previous_sum[7] = 0; previous_sum[6] = 0; previous_sum[5] = 0; previous_sum[4] = 0; previous_sum[3] = 0; previous_sum[2] = 0; previous_sum[1] = 0; previous_sum[0] = 0; } else if (n % 1000000000000000 == 0) { previous_sum[15]++; sum_counter = previous_sum[15] + previous_sum[16] + previous_sum[17] + previous_sum[18]; sum_square_counter = previous_sum[15] * previous_sum[15] + previous_sum[16] * previous_sum[16] + previous_sum[17] * previous_sum[17] + previous_sum[18] * previous_sum[18]; previous_sum[14] = 0; previous_sum[13] = 0; previous_sum[12] = 0; previous_sum[11] = 0; previous_sum[10] = 0; previous_sum[9] = 0; previous_sum[8] = 0; previous_sum[7] = 0; previous_sum[6] = 0; previous_sum[5] = 0; previous_sum[4] = 0; previous_sum[3] = 0; previous_sum[2] = 0; previous_sum[1] = 0; previous_sum[0] = 0; } else if (n % 100000000000000 == 0) { previous_sum[14]++; sum_counter = previous_sum[14] + previous_sum[15] + previous_sum[16] + previous_sum[17] + previous_sum[18]; sum_square_counter = previous_sum[14] * previous_sum[14] + previous_sum[15] * previous_sum[15] + previous_sum[16] * previous_sum[16] + previous_sum[17] * previous_sum[17] + previous_sum[18] * previous_sum[18]; previous_sum[13] = 0; previous_sum[12] = 0; previous_sum[11] = 0; previous_sum[10] = 0; previous_sum[9] = 0; previous_sum[8] = 0; previous_sum[7] = 0; previous_sum[6] = 0; previous_sum[5] = 0; previous_sum[4] = 0; previous_sum[3] = 0; previous_sum[2] = 0; previous_sum[1] = 0; previous_sum[0] = 0; } else if (n % 10000000000000 == 0) { previous_sum[13]++; sum_counter = previous_sum[13] + previous_sum[14] + previous_sum[15] + previous_sum[16] + previous_sum[17] + previous_sum[18]; sum_square_counter = previous_sum[13] * previous_sum[13] + previous_sum[14] * previous_sum[14] + previous_sum[15] * previous_sum[15] + previous_sum[16] * previous_sum[16] + previous_sum[17] * previous_sum[17] + previous_sum[18] * previous_sum[18]; previous_sum[12] = 0; previous_sum[11] = 0; previous_sum[10] = 0; previous_sum[9] = 0; previous_sum[8] = 0; previous_sum[7] = 0; previous_sum[6] = 0; previous_sum[5] = 0; previous_sum[4] = 0; previous_sum[3] = 0; previous_sum[2] = 0; previous_sum[1] = 0; previous_sum[0] = 0; } else if (n % 1000000000000 == 0) { previous_sum[12]++; sum_counter = previous_sum[12] + previous_sum[13] + previous_sum[14] + previous_sum[15] + previous_sum[16] + previous_sum[17] + previous_sum[18]; sum_square_counter = previous_sum[12] * previous_sum[12] + previous_sum[13] * previous_sum[13] + previous_sum[14] * previous_sum[14] + previous_sum[15] * previous_sum[15] + previous_sum[16] * previous_sum[16] + previous_sum[17] * previous_sum[17] + previous_sum[18] * previous_sum[18]; previous_sum[11] = 0; previous_sum[10] = 0; previous_sum[9] = 0; previous_sum[8] = 0; previous_sum[7] = 0; previous_sum[6] = 0; previous_sum[5] = 0; previous_sum[4] = 0; previous_sum[3] = 0; previous_sum[2] = 0; previous_sum[1] = 0; previous_sum[0] = 0; } else if (n % 100000000000 == 0) { previous_sum[11]++; sum_counter = previous_sum[11] + previous_sum[12] + previous_sum[13] + previous_sum[14] + previous_sum[15] + previous_sum[16] + previous_sum[17] + previous_sum[18]; sum_square_counter = previous_sum[11] * previous_sum[11] + previous_sum[12] * previous_sum[12] + previous_sum[13] * previous_sum[13] + previous_sum[14] * previous_sum[14] + previous_sum[15] * previous_sum[15] + previous_sum[16] * previous_sum[16] + previous_sum[17] * previous_sum[17] + previous_sum[18] * previous_sum[18]; previous_sum[10] = 0; previous_sum[9] = 0; previous_sum[8] = 0; previous_sum[7] = 0; previous_sum[6] = 0; previous_sum[5] = 0; previous_sum[4] = 0; previous_sum[3] = 0; previous_sum[2] = 0; previous_sum[1] = 0; previous_sum[0] = 0; } else if (n % 10000000000 == 0) { previous_sum[10]++; sum_counter = previous_sum[10] + previous_sum[11] + previous_sum[12] + previous_sum[13] + previous_sum[14] + previous_sum[15] + previous_sum[16] + previous_sum[17] + previous_sum[18]; sum_square_counter = previous_sum[10] * previous_sum[10] + previous_sum[11] * previous_sum[11] + previous_sum[12] * previous_sum[12] + previous_sum[13] * previous_sum[13] + previous_sum[14] * previous_sum[14] + previous_sum[15] * previous_sum[15] + previous_sum[16] * previous_sum[16] + previous_sum[17] * previous_sum[17] + previous_sum[18] * previous_sum[18]; previous_sum[9] = 0; previous_sum[8] = 0; previous_sum[7] = 0; previous_sum[6] = 0; previous_sum[5] = 0; previous_sum[4] = 0; previous_sum[3] = 0; previous_sum[2] = 0; previous_sum[1] = 0; previous_sum[0] = 0; } else if (n % 1000000000 == 0) { previous_sum[9]++; sum_counter = previous_sum[9] + previous_sum[10] + previous_sum[11] + previous_sum[12] + previous_sum[13] + previous_sum[14] + previous_sum[15] + previous_sum[16] + previous_sum[17] + previous_sum[18]; sum_square_counter = previous_sum[9] * previous_sum[9] + previous_sum[10] * previous_sum[10] + previous_sum[11] * previous_sum[11] + previous_sum[12] * previous_sum[12] + previous_sum[13] * previous_sum[13] + previous_sum[14] * previous_sum[14] + previous_sum[15] * previous_sum[15] + previous_sum[16] * previous_sum[16] + previous_sum[17] * previous_sum[17] + previous_sum[18] * previous_sum[18]; previous_sum[8] = 0; previous_sum[7] = 0; previous_sum[6] = 0; previous_sum[5] = 0; previous_sum[4] = 0; previous_sum[3] = 0; previous_sum[2] = 0; previous_sum[1] = 0; previous_sum[0] = 0; } else if (n % 100000000 == 0) { previous_sum[8]++; sum_counter = previous_sum[8] + previous_sum[9] + previous_sum[10] + previous_sum[11] + previous_sum[12] + previous_sum[13] + previous_sum[14] + previous_sum[15] + previous_sum[16] + previous_sum[17] + previous_sum[18]; sum_square_counter = previous_sum[8] * previous_sum[8] + previous_sum[9] * previous_sum[9] + previous_sum[10] * previous_sum[10] + previous_sum[11] * previous_sum[11] + previous_sum[12] * previous_sum[12] + previous_sum[13] * previous_sum[13] + previous_sum[14] * previous_sum[14] + previous_sum[15] * previous_sum[15] + previous_sum[16] * previous_sum[16] + previous_sum[17] * previous_sum[17] + previous_sum[18] * previous_sum[18]; previous_sum[7] = 0; previous_sum[6] = 0; previous_sum[5] = 0; previous_sum[4] = 0; previous_sum[3] = 0; previous_sum[2] = 0; previous_sum[1] = 0; previous_sum[0] = 0; } else if (n % 10000000 == 0) { previous_sum[7]++; sum_counter = previous_sum[7] + previous_sum[8] + previous_sum[9] + previous_sum[10] + previous_sum[11] + previous_sum[12] + previous_sum[13] + previous_sum[14] + previous_sum[15] + previous_sum[16] + previous_sum[17] + previous_sum[18]; sum_square_counter = previous_sum[7] * previous_sum[7] + previous_sum[8] * previous_sum[8] + previous_sum[9] * previous_sum[9] + previous_sum[10] * previous_sum[10] + previous_sum[11] * previous_sum[11] + previous_sum[12] * previous_sum[12] + previous_sum[13] * previous_sum[13] + previous_sum[14] * previous_sum[14] + previous_sum[15] * previous_sum[15] + previous_sum[16] * previous_sum[16] + previous_sum[17] * previous_sum[17] + previous_sum[18] * previous_sum[18]; previous_sum[6] = 0; previous_sum[5] = 0; previous_sum[4] = 0; previous_sum[3] = 0; previous_sum[2] = 0; previous_sum[1] = 0; previous_sum[0] = 0; } else if (n % 1000000 == 0) { previous_sum[6]++; sum_counter = previous_sum[6] + previous_sum[7] + previous_sum[8] + previous_sum[9] + previous_sum[10] + previous_sum[11] + previous_sum[12] + previous_sum[13] + previous_sum[14] + previous_sum[15] + previous_sum[16] + previous_sum[17] + previous_sum[18]; sum_square_counter = previous_sum[6] * previous_sum[6] + previous_sum[7] * previous_sum[7] + previous_sum[8] * previous_sum[8] + previous_sum[9] * previous_sum[9] + previous_sum[10] * previous_sum[10] + previous_sum[11] * previous_sum[11] + previous_sum[12] * previous_sum[12] + previous_sum[13] * previous_sum[13] + previous_sum[14] * previous_sum[14] + previous_sum[15] * previous_sum[15] + previous_sum[16] * previous_sum[16] + previous_sum[17] * previous_sum[17] + previous_sum[18] * previous_sum[18]; previous_sum[5] = 0; previous_sum[4] = 0; previous_sum[3] = 0; previous_sum[2] = 0; previous_sum[1] = 0; previous_sum[0] = 0; } else if (n % 100000 == 0) { previous_sum[5]++; sum_counter = previous_sum[5] + previous_sum[6] + previous_sum[7] + previous_sum[8] + previous_sum[9] + previous_sum[10] + previous_sum[11] + previous_sum[12] + previous_sum[13] + previous_sum[14] + previous_sum[15] + previous_sum[16] + previous_sum[17] + previous_sum[18]; sum_square_counter = previous_sum[5] * previous_sum[5] + previous_sum[6] * previous_sum[6] + previous_sum[7] * previous_sum[7] + previous_sum[8] * previous_sum[8] + previous_sum[9] * previous_sum[9] + previous_sum[10] * previous_sum[10] + previous_sum[11] * previous_sum[11] + previous_sum[12] * previous_sum[12] + previous_sum[13] * previous_sum[13] + previous_sum[14] * previous_sum[14] + previous_sum[15] * previous_sum[15] + previous_sum[16] * previous_sum[16] + previous_sum[17] * previous_sum[17] + previous_sum[18] * previous_sum[18]; previous_sum[4] = 0; previous_sum[3] = 0; previous_sum[2] = 0; previous_sum[1] = 0; previous_sum[0] = 0; } else if (n % 10000 == 0) { previous_sum[4]++; sum_counter = previous_sum[4] + previous_sum[5] + previous_sum[6] + previous_sum[7] + previous_sum[8] + previous_sum[9] + previous_sum[10] + previous_sum[11] + previous_sum[12] + previous_sum[13] + previous_sum[14] + previous_sum[15] + previous_sum[16] + previous_sum[17] + previous_sum[18]; sum_square_counter = previous_sum[4] * previous_sum[4] + previous_sum[5] * previous_sum[5] + previous_sum[6] * previous_sum[6] + previous_sum[7] * previous_sum[7] + previous_sum[8] * previous_sum[8] + previous_sum[9] * previous_sum[9] + previous_sum[12] * previous_sum[12] + previous_sum[13] * previous_sum[13] + previous_sum[14] * previous_sum[14] + previous_sum[15] * previous_sum[15] + previous_sum[16] * previous_sum[16] + previous_sum[17] * previous_sum[17] + previous_sum[18] * previous_sum[18]; previous_sum[3] = 0; previous_sum[2] = 0; previous_sum[1] = 0; previous_sum[0] = 0; } else if (n % 1000 == 0) { previous_sum[3]++; sum_counter = previous_sum[3] + previous_sum[4] + previous_sum[5] + previous_sum[6] + previous_sum[7] + previous_sum[8] + previous_sum[9] + previous_sum[10] + previous_sum[11] + previous_sum[12] + previous_sum[13] + previous_sum[14] + previous_sum[15] + previous_sum[16] + previous_sum[17] + previous_sum[18]; sum_square_counter = previous_sum[3] * previous_sum[3] + previous_sum[4] * previous_sum[4] + previous_sum[5] * previous_sum[5] + previous_sum[6] * previous_sum[6] + previous_sum[7] * previous_sum[7] + previous_sum[8] * previous_sum[8] + previous_sum[9] * previous_sum[9] + previous_sum[10] * previous_sum[10] + previous_sum[11] * previous_sum[11] + previous_sum[12] * previous_sum[12] + previous_sum[13] * previous_sum[13] + previous_sum[14] * previous_sum[14] + previous_sum[15] * previous_sum[15] + previous_sum[16] * previous_sum[16] + previous_sum[17] * previous_sum[17] + previous_sum[18] * previous_sum[18]; previous_sum[2] = 0; previous_sum[1] = 0; previous_sum[0] = 0; } else if (n % 100 == 0) { previous_sum[2]++; sum_counter = previous_sum[2] + previous_sum[3] + previous_sum[4] + previous_sum[5] + previous_sum[6] + previous_sum[7] + previous_sum[8] + previous_sum[9] + previous_sum[10] + previous_sum[11] + previous_sum[12] + previous_sum[13] + previous_sum[14] + previous_sum[15] + previous_sum[16] + previous_sum[17] + previous_sum[18]; sum_square_counter = previous_sum[2] * previous_sum[2] + previous_sum[3] * previous_sum[3] + previous_sum[4] * previous_sum[4] + previous_sum[5] * previous_sum[5] + previous_sum[6] * previous_sum[6] + previous_sum[7] * previous_sum[7] + previous_sum[8] * previous_sum[8] + previous_sum[9] * previous_sum[9] + previous_sum[10] * previous_sum[10] + previous_sum[11] * previous_sum[11] + previous_sum[12] * previous_sum[12] + previous_sum[13] * previous_sum[13] + previous_sum[14] * previous_sum[14] + previous_sum[15] * previous_sum[15] + previous_sum[16] * previous_sum[16] + previous_sum[17] * previous_sum[17] + previous_sum[18] * previous_sum[18]; previous_sum[1] = 0; previous_sum[0] = 0; } else if (n % 10 == 0) { previous_sum[1]++; sum_counter = previous_sum[1] + previous_sum[2] + previous_sum[3] + previous_sum[4] + previous_sum[5] + previous_sum[6] + previous_sum[7] + previous_sum[8] + previous_sum[9] + previous_sum[10] + previous_sum[11] + previous_sum[12] + previous_sum[13] + previous_sum[14] + previous_sum[15] + previous_sum[16] + previous_sum[17] + previous_sum[18]; sum_square_counter = previous_sum[1] * previous_sum[1] + previous_sum[2] * previous_sum[2] + previous_sum[3] * previous_sum[3] + previous_sum[4] * previous_sum[4] + previous_sum[5] * previous_sum[5] + previous_sum[6] * previous_sum[6] + previous_sum[7] * previous_sum[7] + previous_sum[8] * previous_sum[8] + previous_sum[9] * previous_sum[9] + previous_sum[10] * previous_sum[10] + previous_sum[11] * previous_sum[11] + previous_sum[12] * previous_sum[12] + previous_sum[13] * previous_sum[13] + previous_sum[14] * previous_sum[14] + previous_sum[15] * previous_sum[15] + previous_sum[16] * previous_sum[16] + previous_sum[17] * previous_sum[17] + previous_sum[18] * previous_sum[18]; previous_sum[0] = 0; } else { sum_counter++; sum_square_counter += ((n - 1) % 10) * 2 + 1; } // get_sum_and_sum_square_digits(n, sum, sum_square); // assert(sum == sum_counter && sum_square == sum_square_counter); if (prime_table[sum_counter] && prime_table[sum_square_counter]) { lucky_counter++; } } return lucky_counter; } void inout_lucky_numbers() { int n; cin >> n; long long a; long long b; while (n--) { cin >> a >> b; cout << count_lucky_number(a, b) << endl; } } int main() { inout_lucky_numbers(); return 0; }

    Read the article

  • Laptop choice for development: MacBook Pro 17 vs Dell Studio XPS 16 vs HP Envy 15

    - by Shalan
    Hey! First things first - let me state that I am not intending to play games on this - I have narrowed down to these 3 purely based on specs and its individual brand reliability in the market. I intend to primarily use: Visual Studio 2008 Pro a lot (develop and deploy on Windows platforms) SQL Server 2005 Oracle 10g Adobe Photoshop CS4 Microsoft Expression Studio Google Sketchup I currently use a desktop PC (Core2Duo 2.66Ghz with 3GB DDRII memory) running Vista Business 32-bit - and I have to admit that, especially for Visual Studio, its quite sluggish to a point where it affects productivity. Furthermore, I intend to only use the notebook on a table - with a cooled surface, like granite :) - so I would appreciate people's input with regard to heat issues. Im aware that the Dell's primary exhaust gets blocked by the lid when open, but some reviews don't seem to place extraordinary emphasis on heat issues resulting from this. My options for the Dell/Alienware: Core i7 720QM 4GB DDRIII memory ATI mobility 3670 (512) 128GB Solid State Drive 16-inch Full HD RGB-LED LCD display (1080p) 3-year next-business-day support My configuration for the Apple MBP: Core2Duo 2.8Ghz (Im assuming the T9600) 4GB DDRIII memory 128GB Solid State Drive standard 1 year support The one advantage I think of with the MBP is that I can have the addition of OSX (though Im unsure what I would use it for, but purely to play around with a much-boasted-about OS) What are your thoughts on this, especially regarding build-quality, heat, performance and battery-life? Much thanks! ~shalan

    Read the article

  • Application windows have colossal fonts in Enlightenment 17, while system windows are untouched

    - by Matt
    I'm trying to get used to using Enlightenment instead of KDE on my Slackware64 multilib computer, but I'm having a terrible time getting one problem fixed. My fonts are HUGE on application windows - from Firefox to Gimp to Xchat to anything else, all the fonts are 3x the size they should be. But at the same time, the system menu is the correct size. I'm at a loss - I want the applications to have the same DPI as the system menu. When I'm in KDE, they all look normal. I've included a screenshot to show what I'm talking about.

    Read the article

  • Move sendmail from Fedora 1 to a different server ( fedora 12)

    - by tanieboy4u
    We have a sendmail server that also works as DHCP, DNS, and a gateway to our ISP. It has three network interfaces, one for our ISP ( static IP) and the other two is for LANS on different subnet. The hardware is quite old and we've been experiencing downtime due to hardware failures, so we have decided to upgrade the hardware and while at it upgrade the linux OS to Fedora 12. Were trying to do this with minimal downtime. We are planning to take these steps. Install New OS (Fedora 12) on the new server with 3 network interfaces. Install DHCP, BIND, Sendmail, SpamAssassin, MailScanner, Dovecot, Squirrelmail on the new server. Transfer settings from the old server to the new server. ( This is the hardest part that we know). For DHCP and DNS, we can just copy the dhcp leases and conf file and everything should work right? How do we go about moving the users/email accounts from the old server to the new one? Thanks for all your help!

    Read the article

  • CentOS 5 VPN Server won't work

    - by Miro Markarian
    I have a CentOS 5 server configured to be both a L2TP server and a PPTP server + a radius server for hosting the AAA. My problem is that, the L2TP works great and I can connect to it, but can't connect to PPTP and every-time it ends up with error #619 when it gets to the verifying username and password section. Here is the log I got from /var/log/messages Dec 17 07:40:02 serverdl pptpd[8570]: CTRL: Client 5.52.247.62 control connection started Dec 17 07:40:03 serverdl pptpd[8570]: CTRL: Starting call (launching pppd, opening GRE) Dec 17 07:40:03 serverdl pppd[8571]: Plugin radius.so loaded. Dec 17 07:40:03 serverdl pppd[8571]: RADIUS plugin initialized. Dec 17 07:40:03 serverdl pppd[8571]: Plugin radattr.so loaded. Dec 17 07:40:03 serverdl pppd[8571]: RADATTR plugin initialized. Dec 17 07:40:03 serverdl pppd[8571]: Plugin /usr/lib/pptpd/pptpd-logwtmp.so loaded. Dec 17 07:40:03 serverdl pppd[8571]: pptpd-logwtmp: $Version$ Dec 17 07:40:03 serverdl pppd[8571]: pppd 2.4.4 started by root, uid 0 Dec 17 07:40:03 serverdl pppd[8571]: Using interface ppp0 Dec 17 07:40:03 serverdl pppd[8571]: Connect: ppp0 <--> /dev/pts/2 Dec 17 07:40:03 serverdl pptpd[8570]: GRE: read(fd=7,buffer=80515e0,len=8260) from network failed: status = -1 error = Protocol not available Dec 17 07:40:03 serverdl pptpd[8570]: CTRL: GRE read or PTY write failed (gre,pty)=(7,6) Dec 17 07:40:03 serverdl pppd[8571]: Modem hangup Dec 17 07:40:03 serverdl pppd[8571]: Connection terminated. Dec 17 07:40:03 serverdl pppd[8571]: Exit. Dec 17 07:40:03 serverdl pptpd[8570]: CTRL: Client 5.52.247.62 control connection finished Just yesterday when I hadn't set up the L2TP yet PPTP was working great but then I uninstalled it and removed all it's config from /etc/* and installed L2TP first and then installed PPTP after it. and then it stopped to work. I believe it must be a radiusclient issue because both of the PPTP and L2TP services use radius to authenticate. And another thing I think must be the issue is that when assigning IPs to the PPP interfaces, I have done the following config. Is that right? For L2TP: localip 10.10.10.1 remoteip 10.10.10.2-254 For PPTP: localip 10.10.9.1 remoteip 10.10.9.2-254

    Read the article

  • Fedora 17 disponible, Beefy Miracle intègre les versions les plus récentes des applications et technologies open source

    Fedora 17 disponible Beefy Miracle intègre les versions les plus récentes des applications et technologies open source Mise à jour du 30/05/2012 Fedora 17 alias « Beefy Miracle » est disponible en version stable. La distribution Linux soutenue par Red Hat, et utilisée comme socle pour RHEL ou CentOS, est principalement centrée autour de l'intégration des applications et technologies les plus récentes de l'écosystème open source, avec un cycle de développement rapide de six mois. Fedora 17 ne déroge pas à cette règle, et propose les derniers outils et technologies pour le développement d'applications, le su...

    Read the article

  • Fedora 19 no longer bootable

    - by Parisa
    I had fedora dual-booted with windows on my laptop for a while but with windows refresh grub was gone and my system directly booted windows. I booted fedora with my systems boot options and with this tutorial: https://fedoraproject.org/wiki/GRUB_2 I reinstalled grub2 but then had my system booted into an empty grub prompt: grub So I found the drive containing vmlinuz and initramfs (completely sure about thair location and versions) and tried to manually boot it but after the boot command it said: no suitable video mode found booting in blind mode and nothing happened. Such a tragedy... I have already tried to use live disks rescue system. Funny but troubleshooting options don't apear on my laptop while they do on my desktop pc. I cant even go to boot prompt on my lenovo idepad z400 laptop. I also tried EasyBCD so maybe I could boot it with windows but it comes up with this error: missing AutoNeoGrub().mbr Now I have removed the grub prompt (don't know why) and its really hard for me to reinstall my dearly customized fedora. If anyone knows a way to help boot it again or reinstall it keeping my files and installations I really need it. Thanks PS:I have already tried Boot-repair Disk but it asks me to enable the repo containing grub-efi on my fedora to reinstall the grub2 and fix the boot for me (how could i?).

    Read the article

  • Fedora Core 6 Migration

    - by Matthew Sprankle
    I am at a loss as to what I should to for this server. I need it to run php5.3 and corresponding version of mysql. I received a client today through work that is using Fedora core 6 running 10 very small websites on some very hodge podge setup. My original idea was just upgrade to php5.3. I have yum (installed 3.0.8) reconfigured for the fedora archive. The latest version of php it allows is 5.1.8. I am still relatively new to server setups and am nervous about wiping their server to upgrade it. Since it is about 6-8 years old I'm not sure if it will even support the newest version of fedora. The server specs are: Parallels Plesk Panel version 9.5.4 Operating system Linux 2.6.9-023stab048.4-smp CPU GenuineIntel, Intel(R) Xeon(R)CPU E5335 @ 2.00GHz (10gb disk space and 1gb of memory). I use fedora for my personal server so I was a little familiar with it. I haven't done anything too extravagant. Is there a way I can escape this nightmare with installing php5.3 or do I need to migrate these sites to a new server?

    Read the article

  • Why No android.content.SyncAdapter meta-data registering sync-adapter?

    - by mobibob
    I am following the SampleSyncAdapter and upon startup, it appears that my SyncAdapter is not configured correctly. It reports an error trying to load its meta-data. How can I isolate the problem? You can see the other accounts in the system that register correctly. Logcat: 12-21 17:10:50.667 W/PackageManager( 121): Unable to load service info ResolveInfo{4605dcd0 com.myapp.syncadapter.MySyncAdapter p=0 o=0 m=0x108000} 12-21 17:10:50.667 W/PackageManager( 121): org.xmlpull.v1.XmlPullParserException: No android.content.SyncAdapter meta-data 12-21 17:10:50.667 W/PackageManager( 121): at android.content.pm.RegisteredServicesCache.parseServiceInfo(RegisteredServicesCache.java:391) 12-21 17:10:50.667 W/PackageManager( 121): at android.content.pm.RegisteredServicesCache.generateServicesMap(RegisteredServicesCache.java:260) 12-21 17:10:50.667 W/PackageManager( 121): at android.content.pm.RegisteredServicesCache$1.onReceive(RegisteredServicesCache.java:110) 12-21 17:10:50.667 W/PackageManager( 121): at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:892) 12-21 17:10:50.667 W/PackageManager( 121): at android.os.Handler.handleCallback(Handler.java:587) 12-21 17:10:50.667 W/PackageManager( 121): at android.os.Handler.dispatchMessage(Handler.java:92) 12-21 17:10:50.667 W/PackageManager( 121): at android.os.Looper.loop(Looper.java:123) 12-21 17:10:50.667 W/PackageManager( 121): at com.android.server.ServerThread.run(SystemServer.java:570) 12-21 17:10:50.747 D/Sources ( 294): Creating external source for type=com.skype.contacts.sync, packageName=com.skype.raider 12-21 17:10:50.747 D/Sources ( 294): Creating external source for type=com.twitter.android.auth.login, packageName=com.twitter.android 12-21 17:10:50.747 D/Sources ( 294): Creating external source for type=com.example.android.samplesync, packageName=com.example.android.samplesync 12-21 17:10:50.747 W/PackageManager( 121): Unable to load service info ResolveInfo{460504b0 com.myapp.syncadapter.MySyncAdapter p=0 o=0 m=0x108000} 12-21 17:10:50.747 W/PackageManager( 121): org.xmlpull.v1.XmlPullParserException: No android.content.SyncAdapter meta-data 12-21 17:10:50.747 W/PackageManager( 121): at android.content.pm.RegisteredServicesCache.parseServiceInfo(RegisteredServicesCache.java:391) 12-21 17:10:50.747 W/PackageManager( 121): at android.content.pm.RegisteredServicesCache.generateServicesMap(RegisteredServicesCache.java:260) 12-21 17:10:50.747 W/PackageManager( 121): at android.content.pm.RegisteredServicesCache$1.onReceive(RegisteredServicesCache.java:110) 12-21 17:10:50.747 W/PackageManager( 121): at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:892) 12-21 17:10:50.747 W/PackageManager( 121): at android.os.Handler.handleCallback(Handler.java:587) 12-21 17:10:50.747 W/PackageManager( 121): at android.os.Handler.dispatchMessage(Handler.java:92) 12-21 17:10:50.747 W/PackageManager( 121): at android.os.Looper.loop(Looper.java:123) 12-21 17:10:50.747 W/PackageManager( 121): at com.android.server.ServerThread.run(SystemServer.java:570)

    Read the article

  • Installing Fedora 11 fIlesystem from ISO in to a VM image

    - by okhalid
    Hi, I need to install Fedora 11 in my monitor-less linux box which is running some where in a data center. I will use Fedora 11 as a virtual machine. What I already know/have: 1) How to create LVM partitions and create ext3 filesystem 2) Mount the LVM partition and ISO image 3) Run the partition with Xen as a virtual machine What I need: 1) I need to install Fedora ll file system into an lvm partition (let's say /dev/fedora11) from an ISO image so that I have all the directories /root, /bin, /sys etc etc under /dev/fedora11 Any help would be much appreciated! NOTE: I don't have a monitor for this server, so I need to do it via SSH

    Read the article

  • remote desktop to Fedora 20 with xrdp

    - by 5YrsLaterDBA
    I was able to setup xrdp on my Fedora 13 machine and access it from my Windows 7 machine by follow the steps on the first post on this thread It was simple and easy. But when i try the same on my Fefora 20 machine, things are quite different. There is no error message but some new info like these: # chkconfig --levels 35 xrdp on Note: Forwarding request to 'systemctl enable xrdp.service'. # service xrdp start Redirecting to /bin/systemctl start xrdp.service and then I cannot remote it from my window machine. I also did the following based on the last post of above threa: # yum -y install tigervnc-server Any configuration I should do to make xrdp works for me? I was able to ping each other. EDIT: I can access the shared folder on my Windows machine from my Fedora 20. It seems the problem is on the Fedora side. how to know the service on linux is running? The "service --status-all" cannot give me useful information.

    Read the article

  • fedora liveUSB fails, drops to debug shell

    - by evan
    Trying to install Fedora 15 via a live USB made with unetbootin. I get to the unetbootin boot menu, select Fedora-15-x86_64-Live-Desktop.is, I get to this screen, then it drops into a debug shell with the message sh: can't access tty: job control turned off. The last message is dmseg is dracut Warning: No root device "live:/dev/disk/by-label/Fedora-15-Beta-x86_64-Live-Desktop.is" found. Seems to be the same problem detailed here. Tried to try nk1eto's solution but there is no by-label directory in /dev/disk. There's by-id, by-path and by-uuid.

    Read the article

  • How to resize the disk of a Fedora guest VM in VMWare ESXi

    - by Cerin
    How do I resize (specifically increase) the disk size of a Fedora guest VM running under VMWare ESXi 4.1? I have a Fedora 16 VM with an ext4 formatted disk, and I've increased its disk size using the vSphere client from 50GB to about 250GB. I rebooted the guest, and it correctly shows this size using fdisk -l /dev/sda. However, df -H still shows the old size. I've found a few KB articles explaining how to resize partitions for some flavors of Linux, but nothing for Fedora with ext4. That article seems to imply I have to create a completely new partition, and that I can't simply expand the existing partition. Using Gparted, it also prevents me from simply resizing the existing partition. Is this impossible to do under Linux?

    Read the article

  • Virtualbox won't run Fedora 10 64 bit iso

    - by David
    I am using VirtualBox on a Ubuntu 10.04 64bit host. I would like to install a Fedora 64bit guest. When I try to run the 64bit live cd, it says "Automatic boot in 10 seconds..." after which I get a blue background with no menu options. I am familiar with Ubuntu but not Fedora. I have been able to install a Fedora 32 bit system just fine. Any suggestions? I am trying to run an rpm that won't run in Ubuntu even using alien. .

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >