Skip to content

Instantly share code, notes, and snippets.

@gsarkarsavo
gsarkarsavo / webcrawler.js
Created February 20, 2017 05:43 — forked from amoilanen/webcrawler.js
Simple PhantomJS-based web crawler library
//PhantomJS http://phantomjs.org/ based web crawler Anton Ivanov anton.al.ivanov@gmail.com 2012
//UPDATE: This gist has been made into a Node.js module and now can be installed with "npm install js-crawler"
//the Node.js version does not use Phantom.JS, but the API available to the client is similar to the present gist
(function(host) {
function Crawler() {
this.visitedURLs = {};
};

What / Why

Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.

As the name says, its primary function is to be used in the deploy process, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.

How to

  1. Generate a ssh key
@gsarkarsavo
gsarkarsavo / xdebug
Created June 13, 2017 13:25 — forked from kramarama/xdebug
install xdebug on centos
http://xdebug.org/install.php#configure-php
http://blog.jetbrains.com/phpstorm/2013/08/debugger-configuration-validation-with-phpstorm/
on CentOS:
1. You need to install PHP’s devel package for PHP commands execution
yum install php-devel
yum install php-pear
2. Next install GCC and GCC C++ compilers to compile Xdebug extension yourself.
yum install gcc gcc-c++ autoconf automake
wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
@gsarkarsavo
gsarkarsavo / Get-FtpDirectory.ps1
Created December 1, 2017 08:46 — forked from arthurdent/Get-FtpDirectory.ps1
Recursively list all files in FTP directory in PowerShell / List files (recursive)
$Server = "ftp://ftp.example.com/"
$User = "[email protected]"
$Pass = "[email protected]"
Function Get-FtpDirectory($Directory) {
# Credentials
$FTPRequest = [System.Net.FtpWebRequest]::Create("$($Server)$($Directory)")
$FTPRequest.Credentials = New-Object System.Net.NetworkCredential($User,$Pass)
$FTPRequest.Method = [System.Net.WebRequestMethods+FTP]::ListDirectoryDetails

#Node - File Paths

##File Paths Node has a path module which can be used to manipulate paths.

###Normalizing Paths Paths can be stored in different ways and it is neccessary to ensure that the path is standardized.

var path = require('path');
path.normalize('/foo/bar//baz/asdf/quux/..');
@gsarkarsavo
gsarkarsavo / FTP Client.cs
Created February 13, 2018 10:49 — forked from aliprogrammer69/FTP Client.cs
FTP Client
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
public class FtpClient
@gsarkarsavo
gsarkarsavo / ftp.cs
Created February 13, 2018 10:51 — forked from veyselsahin/ftp.cs
FTP Class For C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net;
using System.Text.RegularExpressions;
namespace SystemEx
{
using System.Diagnostics;
using System.Data;
using System.Collections;
using Microsoft.VisualBasic;
using System.Collections.Generic;
using System;
using System.Net;
using System.IO;
using System.Text.RegularExpressions;
@gsarkarsavo
gsarkarsavo / Cleanup ClickOnce Apps
Created February 13, 2018 14:37
Cleanup ClickOnce Apps
Run this:
rundll32 dfshim CleanOnlineAppCache
Delete everything from:
C:\Users\%USERPROFILE%\Local Settings\Apps\2.0