working on it ...


Explore Public Snippets

Sort by

Found 17k snippets matching: disco

    public by cghersi modified Apr 3, 2013  3194  1  5  0

    BATCH MS-DOS: Simulate network disconnection

    This command can be used to simulate a broken network connection towards a particular IP. In the example, is the IP that we want to break the connection with; is another IP of a physical machine present in the LAN.
    rem break the connection
    route add mask
    rem re-establish the connection
    route delete

    public by DavidEGrayson modified Apr 12, 2016  2498  0  3  0

    This is a copy of

    This is a copy of
    I just encountered a bug while I was writing a post on a Discourse-powered forum and would like to report it.
    It seems like if I have two fenced code blocks with an info string of "{.cpp}", where each block starts with a line equal to "\`\`\`{.cpp}" and ends with a line equal to "\`\`\`", then any text formatting between the two blocks of code does not work at all, and we see the markup instead of seeing nicely-formatted text.  See below for an example:
    // Here is a block of C++ code.
    For some reason we cannot have `monospace`, _italic_, **bold**, or [link]( text in this paragraph, which is between two blocks of C++ code.  In fact, I can't find any other Markdown, BBCode or HTML that does work in this area.
    We can't even have multiple paragraphs.
    // Here is a second block of C++ code.
    A workaround for this is to remove the `{.cpp}` info string on the first code block, but of course that destroys the code highlighting in that first block.  I couldn't find any better solution even though I tried info strings of ".cpp", "cpp", and "c++".
    I made a [copy of this post as a Gist]( so you can see the markup I used and verify that it works correctly in GitHub-flavored Markdown.

    public by romych78 modified Jan 30, 2015  1816  3  6  0

    Linux shell processes discovery

    // to show processes which blocking files on file system (in the example filter by specific value)
    lsof -n | awk '/sess_/'
    // what processes doing right now
    ps -e -o pid,comm,wchan=WIDE-WCHAN-COLUMN  
    // more details about some process with PID, for example, 10406
    strace -p 10406

    public by papershredder432 modified Dec 20, 2017  232  0  4  0

    Error for Discord Bot

    (node:8748) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of null at (C:\Users\Ulti\Desktop\Misc\AngelicGaming\node_modules\discord.js-commando\src\commands\message.js:230:28) at at runMicrotasksCallback (internal/process/next_tick.js:115:5) at process._tickCallback (internal/process
    const commando = require('discord.js-commando');
    class EightBallCommand extends commando.Command {
        constructor(client) {
            super(client, {
                name: '8ball',
                group: 'random',
                memberName: '8ball',
                description: 'Ever hear of an 8-Ball? Well that is what this command is.'
        async run(message, args) {
            var answers = [
                'Yes.', 'No.', 'Possibly.', 'Maybe.', 'Never.', 'Of course.', 'Reply hazy try again.'
            var answers = answers[Math.floor(Math.random() * answers.length)];
            if(message.content === ""){
                bot.reply('There is nothing you are asking! Try again but ask a question this time')
    module.exports = EightBallCommand;

    public by cghersi modified Mar 18, 2014  2709  1  7  1

    How to detect the current IP addresses of local machine in Java

    This method checks the local network interfaces to discover the actual IP address associated, trying to skip the bogus addresses (localhost, virtual ones, etc.)
    private static ArrayList<String> retrieveLocalIPs(){
    	ArrayList<String> defaultStr = new ArrayList<String>(); 
    		Enumeration<NetworkInterface> ni = NetworkInterface.getNetworkInterfaces();
    			NetworkInterface currni = ni.nextElement();
    			if (!currni.isLoopback() && 	// no loopback addresses or interfaces
    				!currni.isVirtual() && 		// no virtual network interfaces
    				currni.isUp()) { 			// only active network interfaces are considered here
    				Enumeration<InetAddress> addresses = currni.getInetAddresses();
    					InetAddress address = addresses.nextElement();
    					if (!address.isLoopbackAddress() && 	// no loopback addresses here, please
    						!address.isMCSiteLocal() && 	  	// no multicast addressed	
    						(address.getHostName() != null) &&	// hostname should not be null        						        						
    						(address instanceof Inet4Address)) { 	  // only ipv4 addresses	    					
    						//ok, we got the address: not we have to check if it is well formed:        					
    							/* address is something like mypc.domain/, 
    							 * therefore we have to extract only the IP address: 
    							String str2add = address.toString().split("\\/")[1];
    							if (validateIPv4Address(str2add)) {
    								log.warn("skipping bogus ipv4 address " + str2add);
    							if (validateIPv4Address(address.toString())) {
    								log.warn("skipping bogus ipv4 address " + address.toString());
    	}catch(Exception ex) {
    		return null;
    	return defaultStr;
    private static boolean validateIPv4Address(String ipAddress) {
    	String[] parts = ipAddress.split( "\\." );
    		if (parts.length != 4)
    			return false;
    		for (String s : parts) {
    			int i = Integer.parseInt(s);
    			if ((i < 0) || (i > 255)) 
    				return false;
    	}catch(Exception er){
    		return false;
    	return true;

    public by marksimon232 modified Jan 24, 2015  2542  1  5  2

    SQL SERVER 2012

    Am migrating sql server 2005 to sql server 2012 . what are all the changes need to be done in stored procedures/ discontinued features in 2012?.Thanks in advance.
    The simplest solution I see is just do follows;
    In General guide for upgrading the database.
        1) Run upgrade advisor on the databases for the instance you want to upgrade.
        2) If any issues found, talk to your dev team/ Vendor for fixing the same.
        3) If issues fixed proceed with the actual upgrade. -- Do check for the other dependencies on the database which might effect the functionality if the instance gets upgraded or something like that.
        4) Get the downtime for the database.
        5) create a latest full backup of the database -- any other strategy will also work, just make sure you can recover the database.
        6) take a clone of the server if its a virtual server to roll back any changes.
        7) run the upgrade on the sql 2005 instance from the 2012 set up. -- do check the pre-requirements for upgrade to sql 2012.
        8) If everything fine then you have a upgraded instance.
        9) also check the compatibility of the databases.
        10)if all fine then congrats you have upgraded your sql server instance.
    When you migrating to SQL 2012, this points needs to be consider first.
    - Using the SQL 2012 Upgrade Advisor
    - Reviewing the “breaking changes” section in the Books Online
    - Reviewing the “behavioral changes” section in the Books Online
    - Executing DBCC UPDATEUSAGE command (DBCC UPDATEUSAGE(db_name);)
    - Updating statistics (USE db_name; GO EXEC sp_updatestats;) with full scan (USE db_name; GO EXEC sp_MSforeachtable @command1='UPDATE STATISTICS ? WITH FULLSCAN';)
    - Refreshing your views using sp_refreshview
    - Taking backups
    - Upgrading your hardware (As SQL Server 2012 does not support AWE)
    Upgrades are a necessary part of any development lifecycle. The chances of having a successful upgrade increases along with the amount of planning and preparation you invest in building a proper upgrade process.

    public by paulsimmons modified Mar 30, 2017  1069  0  5  0

    Magento Follow Up Emails Extension

    Magento Follow Up Email is a complete extension developed by FMEAddons that allows store owners to integrate and advance email marketing system in their online store based on Magento. With the help of this powerful extension, they can send emails after occurring of different events such as new order completion, Cart abandonment, Birthday, Christmas
    // Enter here the actual content of the snippet.                        

    public by paulsimmons modified Apr 4, 2017  1029  0  5  0

    WooCommerce Variable Pricing Plugin by FMEAddons

    If you want to convert potential customers to successful business leads, then WooCommerce variable pricing extension is a powerful tool for achieving this goal. This addon provides you an easy interface to offer bulk discounts on various sections on your website. You can give a special offer to your customers such as buy three products and get one
    // Enter here the actual content of the snippet.            

    public by Nyx modified Jun 29, 2018  439  3  4  0

    Ectoplasm Roles

    Ectoplasm Roles we use in our server! |
                   Executive Officer
                   Trial Officer
                   Event Manager
                   Chill Bots
                   Event Winner
                   Hibernator  Lvl. 70
                   Dreamer     Lvl. 50
                   Lounger     Lvl. 40
                   Chiller     Lvl. 30
                   Settler     Lvl. 20
                   Relaxer     Lvl. 10
                   Rester      Lvl. 05
                   New Ectoplasm

    public by Magesolution modified Nov 22, 2018  30  0  3  0

    CYBER MONDAY SALE! 50% off All Magento 2 Themes & Extensions by Magesolution

    CYBER MONDAY SALE! 50% off All Magento 2 Themes & Extensions by Magesolution Sale Off 50 % for All Magento 1 & 2 Themes and Extensions by Magesolution ✊✊✊ Are you ready?  Enter code CYBER and you will get 50 % DISCOUNT for every product Join now or regret later! Shop Now:					
    • Public Snippets
    • Channels Snippets