working on it ...

Filters

Explore Public Snippets

Sort by

Found 2,925 snippets matching: protection

    public by AysadKozanoglu modified Sep 12, 2016  128606  1  2  0

    request flood protection rate limiting nginx

    request flood protection rate limiting nginx: nginx-rate_limit_flood_protect.conf
    # To enable rate limiting simply add the following line to the top-level of your config file:
    
    # 1 request / second
    limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s;
    
    # Then apply it to a location by adding a rate  limiting burst to your server block:
    
    location /account/login/ {
        # apply rate limiting
        limit_req zone=login burst=5;
    
        # boilerplate copied from location /
        proxy_pass http://myapp;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
    }
    
    
    

    public by johansonkatherine modified Jun 19, 2014  2851  3  6  1

    PHP Code to Protect a Word Document Using Aspose for Cloud API

    The following technical tip shows how php developers can protect their word documents in cloud using Aspose for Cloud SDK in php.
    use Aspose\Cloud\Common\AsposeApp;
    use Aspose\Cloud\Common\Product;
    use Aspose\Cloud\Common\Utils;
    use Aspose\Cloud\Words\Document;
    
    /**** Section 1 ****/
    Product::$baseProductUri = 'http://api.aspose.com/v1.1';
    AsposeApp::$appSID = "xxxxxxxxxxxxxxxxxxxxxxxx";
    AsposeApp::$appKey = "xxxxxxxxxxxxxxxxxxxxxxxx";
    AsposeApp::$outPutLocation = getcwd() . "/output/";
    /**** End Section 1 ****/
    
    /**** Section 2 ****/
    $fileName = "Test.docx";
    $password = "123456";
    $protectionType = "AllowOnlyComments";
    
    $doc = new Document($fileName);
    $result = $doc->protectDocument($password, $protectionType);
    /**** End Section 2 ****/
    			

    public by msdn modified Jan 12, 2015  753  0  5  0

    UpdateServiceKey: Update the service key value and the protection password.

    Update the service key value and the protection password.
    /// <summary>
    /// Update the service key value and the protection password.
    /// </summary>
    private static void UpdateServiceKey(string displayName, byte[] keyValue, string protectionPassword, ServiceKeyType keyType)
    {
        UTF8Encoding enc = new UTF8Encoding();
        ManagementService svc = ManagementServiceHelper.CreateManagementServiceClient();
    
        ServiceKey serviceKey = svc.ServiceKeys.Where(sk => sk.DisplayName == displayName && sk.Type == keyType.ToString()).First();
    
        serviceKey.Value = keyValue;
        serviceKey.Password = string.IsNullOrEmpty(protectionPassword) ? null : enc.GetBytes(protectionPassword);
    
        svc.UpdateObject(serviceKey);
        svc.SaveChangesBatch();
    }

    external by Github modified Nov 13, 2015  206  0  3  0

    This is your employment contract <a href=" http://www.artopolischicago.com/the-cafe#slippery ">order motilium online </a> The Abbey Protection Directors (all of whose names will be set out in the Scheme Document) accept responsibility for the informat...

    This is your employment contract order motilium online The Abbey Protection Directors (all of whose names will be set out in the Scheme Document) accept responsibility for the information contained in this announcement relating to Abbey Protection, the Abbey Protection Group and themselves and their immediate families, related trusts and Connecte
    This is your employment contract <a href=" http://www.artopolischicago.com/the-cafe#slippery ">order motilium online
    </a>  The Abbey Protection Directors (all of whose names will be set out in the Scheme Document) accept responsibility for the information contained in this announcement relating to Abbey Protection, the Abbey Protection Group and themselves and their immediate families, related trusts and Connected Persons. To the best of the knowledge and belief of the Abbey Protection Directors (who have taken all reasonable care to ensure that such is the case), such information for which they are responsible is in accordance with the facts and does not omit anything likely to affect the import of such information.
     
    
    

    external by Github modified Feb 13, 2016  196  0  2  0

    Total ID Theft ProtectionUniquely combines offline ID protection services, public on September 22, 2009. http://www.vstore.ca/helpdesk/includes/mb.php?gwf=GFIMailArchiver60otc&sef=buy 122 was the last, "Fix It" buttons, and customization controls for ...

    Total ID Theft ProtectionUniquely combines offline ID protection services, public on September 22, 2009. http://www.vstore.ca/helpdesk/includes/mb.php?gwf=GFIMailArchiver60otc&sef=buy 122 was the last, "Fix It" buttons, and customization controls for more advanced users. http://www.vstore.ca/helpdesk/includes/mb.php?gwf=AutodeskAutoCADElectlxo&se
    Total ID Theft ProtectionUniquely combines offline ID protection services, public on September 22, 2009.  http://www.vstore.ca/helpdesk/includes/mb.php?gwf=GFIMailArchiver60otc&sef=buy 122 was the last, "Fix It" buttons, and customization controls for more advanced users.  http://www.vstore.ca/helpdesk/includes/mb.php?gwf=AutodeskAutoCADElectlxo&sef=buy  Total ID Theft ProtectionUniquely combines offline ID protection services, maizena e, sempre con lo sbattitore in funzione.  http://www.vstore.ca/helpdesk/includes/mb.php?gwf=ACDSeePro3tot&sef=buy 
    
    
    

    external by Thomas Sjolshagen modified May 30, 2016  107  0  2  0

    Proof of Concept for bulk-updating posts with membership protection (if the post didn't previously have protection)

    Proof of Concept for bulk-updating posts with membership protection (if the post didn't previously have protection): pmpro-bulk-update.php
    <?php
    /*
    Plugin Name: PMPro Bulk Update
    Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
    Description: Allow updating all posts to a membership level
    Version: .1
    Author: Thomas Sjolshage <thomas@eighty20results.com>
    Author URI: http://www.eighty20results.com/thomas-sjolshagen/
    */
    
    function pmprobu_update_all_posts() {
    
    	error_log("Trigger update of posts to set membership level(s)");
    
    	global $wpdb;
    
    	$nSQL = $wpdb->prepare("
    		SELECT p.ID
    		FROM {$wpdb->posts} AS p
    		WHERE ((post_type = 'post') AND (p.ID NOT IN (SELECT page_id FROM {$wpdb->pmpro_memberships_pages})))
    	");
    
    	$not_protected = $wpdb->get_col($nSQL);
    
    	if (!empty( $not_protected)) {
    
    		$sql = array();
    
    		$sql[] = "
    			INSERT INTO {$wpdb->pmpro_memberships_pages} ( membership_id, modified, page_id )	  
    			SELECT 1,  NOW(), p.ID
    			FROM {$wpdb->posts} AS p
    			WHERE (post_type = 'post') AND (p.ID NOT IN (" . implode(",", $not_protected) . "))";
    
    		$sql[] = "
    			INSERT INTO {$wpdb->pmpro_memberships_pages} ( membership_id, modified, page_id )	  
    			SELECT 2,  NOW(), p.ID
    			FROM {$wpdb->posts} AS p
    			WHERE (post_type = 'post') AND (p.ID NOT IN (" . implode(",", $not_protected) . "))";
    
    		$sql[] = "
    			INSERT INTO {$wpdb->pmpro_memberships_pages} ( membership_id, modified, page_id )	  
    			SELECT 3,  NOW(), p.ID
    			FROM {$wpdb->posts} AS p
    			WHERE (post_type = 'post') AND (p.ID NOT IN (" . implode(",", $not_protected) . "))";
    
    		foreach( $sql as $s ) {
    
    			error_log("Wanting to run query: {$s}");
    
    			if (false === $wpdb->query($s)) {
    
    				wp_die("Failure while updating the page/protection information! Error: {$wpdb->last_error}" );
    
    			} else {
    				error_log("Successfully updated Database w/new post protection");
    			}
    		}
    	}
    }
    
    register_activation_hook( __FILE__, 'pmprobu_update_all_posts' );
    
    

    external by Martin Nguyen modified Nov 5, 2015  103  0  2  0

    Using debug extensions developer mode enough protectionUsing debug extensions developer mode enough protection

    Using debug extensions developer mode enough protectionUsing debug extensions developer mode enough protection: developer-mode-extension-debug
    Using debug extensions / developer mode enough protection
    
    up vote
    15
    down vote
    favorite
    There are some nice extensions for Magento developers that you usually do not want to have on a live system.
    
    How can you keep them in the project repository but avoid them to be exposed on a live shop?
    
    development debug developer-mode
    shareimprove this question
    edited May 22 at 12:09
    
    7ochem
    2,11541340	
    asked Jan 25 '13 at 8:54
    
    Alex
    5,62232669
    add a comment
    7 Answers
    activeoldestvotes
    up vote
    18
    down vote
    accepted
    There are two relatively new techniques to do it:
    
    Use modman so you will be able control by yourself what to deploy for each environment. This means you run modman deploy [name-of-dev-extension] only at your dev environment.
    
    Use magento-composer with different composer.json scenarios for different environments. And even easier way is to specify those extensions as dev-modules and then install the project using the --require-dev switch on your development machine.
    
    shareimprove this answer
    edited Sep 18 '13 at 19:12
    
    answered Jan 25 '13 at 9:25
    
    Tim Bezhashvyly
    7,89232055
    1	 	
    + one for reffering to modman :) nice option – Toon Van Dooren Jan 25 '13 at 9:44
      	 	
    Can you describe more how that environment-specific deployment would look like? I mean where do I keep the list of modules I deploy? Usually I have a folder of all the modules - and so again I have to separate live and development. – Alex Jan 25 '13 at 23:06 
      	 	
    @Alex: please see my edit. – Tim Bezhashvyly Feb 7 '13 at 15:05
      	 	
    @Tim: thanks! I also edited your answer now. – Alex Feb 7 '13 at 17:23
      	 	
    @Alex: Thanks. I didn't knew this :-) – Tim Bezhashvyly Feb 7 '13 at 17:30 
    add a comment
    up vote
    9
    down vote
    Those usually can be disabled conveniently with a configuration flag, so they are technically active but not doing anything. If you set this flag to false in app/etc/local.xml of your live system, you should be fine.
    
    shareimprove this answer
    answered Jan 25 '13 at 9:08
    
    fschmengler
    14k12885
      	 	
    This is a good solution unless you want to keep your local.xml file in your repo. Which might be a case. – Tim Bezhashvyly Jan 25 '13 at 12:40
      	 	
    Great answer - local.xml is usually not in the repo – Alex Jan 25 '13 at 23:04
    add a comment
    up vote
    5
    down vote
    See MageTrashApp which was created at the Magento Hackathon in Berlin recently. Allows you to de-activate modules via the admin panel.
    
    shareimprove this answer
    answered Feb 10 '13 at 7:02
    
    Karen Baker
    1,238317
    add a comment
    up vote
    4
    down vote
    A simple way to do this is, is disabling the module in /etc/modules, pushing it, ignore the file locally and enable it again.
    
    shareimprove this answer
    answered Jan 25 '13 at 9:04
    
    Toon Van Dooren
    740416
      	 	
    In this case you will be limited on making modifications to extensions bootstrap file (for instance modifying dependencies). Also if you will check out let's say on your other machine you will have to make al those tricks once again. Might be even more inconvenient with a team of several developers. – Tim Bezhashvyly Jan 25 '13 at 12:38
      	 	
    If you ignore the file locally the only thing other devs have to do is enable it again. This takes only a few seconds imho. – Toon Van Dooren Jan 25 '13 at 15:20
      	 	
    Right. But then they again have to ignore it locally. And this is for each extension for each working copy. I mean your solution will definitely work but is a bit inconvenient. – Tim Bezhashvyly Jan 25 '13 at 15:40
      	 	
    true, i guess i just looked at it from my position, i usually integrate only 1 or 2 dev tools :-) – Toon Van Dooren Jan 25 '13 at 16:42
    add a comment
    up vote
    2
    down vote
    I think the best way of dealing with this is either keep all of those modules in the local codePool and disable all local modules on live with this line in your local.xml:
    
        <disable_local_modules>true</disable_local_modules>
    Or you can do "Disable Module Output" in the backend on your live environment. (System -> Configuration -> Advanced). However this doesn't entirely disable the module. But maybe it's just enough of want you want to hide of it.
    
    The only other thing I can think of is write some code that can pull this off. Just check whether it's in developer mode (Mage::getIsDeveloperMode()) and then disable modules. I found some more details on achieving this here: http://stackoverflow.com/questions/6520634/magento-how-to-disable-module-programmatically
    
    shareimprove this answer
    edited Jan 25 '13 at 9:06
    
    answered Jan 25 '13 at 9:01
    
    Rick Kuipers
    1,8761822
      	 	
    All 3 solutions are not good enough. Disabling local modules will force you to move all other modules from local codePool into community and also do it for all future extensions. Disabling modules output as you said still lets extension run slowing down your store. And the 3rd solution will require modifications that will be overwritten with extension(s) update. – Tim Bezhashvyly Jan 25 '13 at 12:44
    2	 	
    @Tim I agree, absolutely. There should be a better way of dealing with this, there should be a core configuration of disabling/enabling modules when in develop mode. – Rick Kuipers Jan 25 '13 at 12:48
    add a comment
    up vote
    2
    down vote
    I usually just put them into my testing environment, but do not check them into the version control system, for example by using the .gitignore file to exclude them from being considered for committing.
    
    shareimprove this answer
    answered Jan 25 '13 at 11:45
    
    mpaepper
    2,6671833
      	 	
    OP emphasized on keeping extensions in repository. – Tim Bezhashvyly Jan 25 '13 at 12:34 
    add a comment
    up vote
    0
    down vote
    There is a slide in Imagine 2011 conference by Erik Hansen. He stated a code in the slide which is as below ( for developer mode )
    
    # File : index.php
    if(preg_match('/^stage\.|\.dev$/', $_SERVER['HTTP_HOST'])) {
       $_SERVER['MAGE_IS_DEVELOPER_MODE'] = true;
    }
    here is, Erik enabling a setting based on the subdomains which you can customize it yourself.
    
    shareimprove this answer
    answered Jan 26 '13 at 12:42
    
    Oğuz Çelikdemir
    54637
      	 	
    what does this have to do with modules for development? – bryan_ruiz Jan 28 '13 at 4:11
      	 	
    Dear @bryan_ruiz, the Magento system checking the MAGE_IS_DEVELOPER_MODE whether active or not. Check Alan's article. Magento Developer Mode – Oğuz Çelikdemir Jan 28 '13 at 6:26 
      	 	
    what im saying is i dont understand how this relates to the question. developer mode wont enable or disable the modules he is using. – bryan_ruiz Jan 28 '13 at 6:50
      	 	
    Bryan, as I specified in my comment, you can customize the code that as your request. Of course, raw idea doesn't fit of the request. For instance, if you written your extension depends on a parameter, you can check or control above snippet! – Oğuz Çelikdemir Jan 28 '13 at 8:23
    add a comment
    Your Answer
    
    

    external by Github modified Dec 21, 2015  183  0  2  0

    I'm at Liverpool University http://www.katebrangan.com/index.php?/research-paper-online/ chapter floored comparison essay suburb In 2011, the U.S. Environmental Protection Agency approved an Idaho Department of Environmental Quality rule exempting act...

    I'm at Liverpool University http://www.katebrangan.com/index.php?/research-paper-online/ chapter floored comparison essay suburb In 2011, the U.S. Environmental Protection Agency approved an Idaho Department of Environmental Quality rule exempting activities such as mining from review, provided their accompanying water pollution fell below a certa
    I'm at Liverpool University http://www.katebrangan.com/index.php?/research-paper-online/ chapter floored comparison essay suburb  In 2011, the U.S. Environmental Protection Agency approved an Idaho Department of Environmental Quality rule exempting activities such as mining from review, provided their accompanying water pollution fell below a certain threshold.
     http://www.zorgenbijstand.nl/zorg/religion-research-paper/ sensation essay on my dream partner naturalists choked  They recruited 224 patients who had smoked at least five cigarettes per day before their hospitalization, were at least 18 years old and spoke fluent English. The most common psychiatric diagnoses were depression and schizophrenia.
     
    
    

    external by Github modified Mar 21, 2016  125  0  2  0

    Best Site good looking <a href=" http://funnygirlsonline.co.uk/costco-pharmacy-in-fort-worth.pdf ">american airlines prescription drugs carry</a> Inflation protection is a must-keep feature of home insurance, but like millions of seniors who have down...

    Best Site good looking american airlines prescription drugs carry Inflation protection is a must-keep feature of home insurance, but like millions of seniors who have downsized, you may have reduced your possessions. Review whether you still need special riders on jewelry, furs, computers and other items. : Hailey
    Best Site good looking <a href=" http://funnygirlsonline.co.uk/costco-pharmacy-in-fort-worth.pdf ">american airlines prescription drugs carry</a>  Inflation protection is a must-keep feature of home insurance, but like millions of seniors who have downsized, you may have reduced your possessions. Review whether you still need special riders on jewelry, furs, computers and other items.
     
    
    

    external by Pat modified Mar 24, 2015  114  0  3  0

    A simple bypass of opticcdn protection, set the cookie "optic_auth" to the value the method returns (returns null on failure)

    A simple bypass of opticcdn protection, set the cookie "optic_auth" to the value the method returns (returns null on failure): OpticCdn.cs
    public static string GetOpticCdnCookie(string source)
    {
        var matches = Regex.Matches(source, "var .* = \"(.*)\"");
        if (matches.Count != 10) return null;
        var combined = string.Concat(matches[0].Groups[1].Value, matches[1].Groups[1].Value,
            matches[2].Groups[1].Value, matches[3].Groups[1].Value, matches[8].Groups[1].Value,
            matches[9].Groups[1].Value, matches[4].Groups[1].Value, matches[5].Groups[1].Value,
            matches[6].Groups[1].Value, matches[7].Groups[1].Value);
        using (var sha = new SHA1Managed())
        {
            return BitConverter.ToString(sha.ComputeHash(Encoding.UTF8.GetBytes(combined))).Replace("-", "").ToLowerInvariant().Substring(0, 30);
        }
    }
    
    
    
    • Public Snippets
    • Channels Snippets