Skip to content

Instantly share code, notes, and snippets.

View paveltimofeev's full-sized avatar

Pavel Timofeev paveltimofeev

View GitHub Profile
@paveltimofeev
paveltimofeev / LockPC-full.ps1
Last active September 10, 2015 11:58
Locking PC for 5 min every 1.5 hours (powershell / win)
cls
function ConvertTo-Date
{
param( [string]$time )
return Get-Date -Hour ($time -split ":")[0] -Minute ($time -split ":")[1] -Second 0
}
function Get-WhatSooner
@paveltimofeev
paveltimofeev / serv.go
Last active October 2, 2015 15:10
Simple Go server
package main
import "net/http"
import "time"
import "log"
func main() {
s := &http.Server{
Addr: ":8080",
//Handler: myHandler,
@paveltimofeev
paveltimofeev / test.go
Created October 5, 2015 11:05
Go tests
package main
import "fmt"
import "os"
//import "time"
// объявление типа
var text3 uint = 1
// объявление константы
const pi int = 3
// объявление неск. переменных
@paveltimofeev
paveltimofeev / Get-IpLocation.ps1
Last active October 22, 2015 08:57
Get IP Location with PS
function Get-IpLocation($ip)
{
return Invoke-RestMethod "http://ip-api.com/json/$ip"
}
Get-IpLocation -ip 194.226.100.138
@paveltimofeev
paveltimofeev / Trace-Route.ps1
Last active December 1, 2015 12:56
Trace route PS
cls
function Get-IpLocation($ip)
{
return Invoke-RestMethod "http://ip-api.com/json/$ip"
}
function Trace-Route
{
[CmdletBinding()]
@paveltimofeev
paveltimofeev / CatchingGame.cs
Created October 28, 2015 09:22
Catching Game Try/Catch/Finally
/// <summary>
/// Replace ??? with a number(s) of printing order
/// </summary>
class CatchingGame
{
public CatchingGame()
{
Console.WriteLine("1 - Catching Game");
Bob(new Action(Alice), "Alice" );
@paveltimofeev
paveltimofeev / frontendDevlopmentBookmarks.md
Created October 28, 2015 11:21 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@paveltimofeev
paveltimofeev / ejs-example.js
Created November 6, 2015 15:26
ejs example
var ejs = require('ejs');
var template1 = '<?= users.join(" | "); ?>';
var template2 = '<ul><% users.forEach( function(user){ %><li><%= user %></li><% }); %></ul>';
function _render( data, template, delimeter){
return ejs.render( template, data, {delimiter:delimeter} );
}
function UserList( template, delimeter ){
@paveltimofeev
paveltimofeev / git-hints.md
Last active April 5, 2017 12:23
Git hints & Tricks

Git hints & Tricks

# GET | PULL ONLY ONE CONCRETE FILE FROM ANY BRANCH
git fetch
git checkout -m <revision> <yourfilepath>

How to switch from --single-branch mode to all branches

@paveltimofeev
paveltimofeev / WireShark-filters.md
Last active September 26, 2022 00:01
WireShark usefull filters

WireShark filters

© http://www.lovemytool.com/blog/2010/04/top-10-wireshark-filters-by-chris-greer.html

ip.addr == 10.0.0.1 Sets a filter for any packet with 10.0.0.1, as either the source or dest

ip.addr==10.0.0.1 && ip.addr==10.0.0.2 sets a conversation filter between the two defined IP addresses

http or dns sets a filter to display all http and dns

tcp.port==4000 sets a filter for any TCP packet with 4000 as a source or dest port