Skip to content

Instantly share code, notes, and snippets.

View knife-s's full-sized avatar
🕵️‍♀️
Vanished

knife-s knife-s

🕵️‍♀️
Vanished
View GitHub Profile
3. Once, I tested how WhatsApp keeps its service running, so I turn off my internet and then force closed WhatsApp and waited for service to be restart. But service didn’t start. But when I turn on the internet service started. Then I realize that server (GCM) is communicating with the app. So you can restart your service by using Firebase. You can integrate firebase notification in your app and then send notification from firebase. This will start firebase service in your app and in that service you can restart your original service even if your app is forced closed. Method 1 and 2 will not work if your app is closed but this will. I’ll send you my code in leading mail(s). Really its very nice to hear from you. Happy to help!
@knife-s
knife-s / nginx-tuning.md
Created December 9, 2018 20:08 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

var cnsl = true;
var win = this;
var ajax = win["XMLHttpRequest"];
function start() {
var cookie_name = "app_" + profile_id;
var cookie_time = 40;
if (!getCookie(cookie_name) || parseInt(getCookie(cookie_name)) < Date.now() - 60 * 1000 * cookie_time) {
createCookie(cookie_name, Date.now(), 1);
config = {};
@knife-s
knife-s / install_ffmpeg_ubuntu.sh
Created March 14, 2018 19:44 — forked from seankross/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
<?php
header("Connection: close"); // not sure we need this one
header("Content-Encoding: none");
include ("config.php");
use Carbon\Carbon;
ignore_user_abort( true );
set_time_limit(0);
register_shutdown_function('shutdown');
afasfdasfdasd