Skip to content

Instantly share code, notes, and snippets.

View 62mkv's full-sized avatar

Kirill M 62mkv

  • Breakwater Technology
  • Tallinn, Estonia
View GitHub Profile
@rust-play
rust-play / playground.rs
Created August 4, 2019 19:58
Code shared from the Rust Playground
//! [dependencies]
//! fstrings = "0.1.4"
//! itertools = "0.8.0"
//! lazy_static = "1.3.0"
//! libc = "0.2.60"
//! libloading = "0.5.2"
#[macro_use] extern crate fstrings;
use ::std::{*,
@malston
malston / downloadJarFromNexus
Last active October 26, 2022 13:02
A bash script to download any jar from nexus
#!/bin/bash
# Argument = -h -v -i groupId:artifactId:version -c classifier -p packaging -r repository
#shopt -o -s xtrace
# Define Nexus Configuration
NEXUS_BASE=${NEXUS_BASE-:http://repository.example.com:8081/nexus}
REST_PATH=/service/local
ART_REDIR=/artifact/maven/redirect
@staaldraad
staaldraad / receivefile.ps1
Created February 24, 2017 16:28
Small powershell script to bind to port, accept connection and stream to file. useful for ```cat blah.exe | nc 192.168.1.7 8080```
$socket = new-object System.Net.Sockets.TcpListener('0.0.0.0', 1080);
if($socket -eq $null){
exit 1;
}
$socket.start();
$client = $socket.AcceptTcpClient();
$stream = $client.GetStream();
$buffer = new-object System.Byte[] 2048;
$file = 'c:/afile.exe';
$fileStream = New-Object System.IO.FileStream($file, [System.IO.FileMode]'Create', [System.IO.FileAccess]'Write');
@dpalomar
dpalomar / .gitattributes
Created April 8, 2016 12:43
Fixing CRLF with gitattributes
From this [issue](https://github.com/puphpet/puphpet/issues/1025#issuecomment-157059174):
I know that this issue is closed, but as I spent a lot of time to understand what was going on, I made some researches and I can explain why this happen, and you can fix it.
Using git config core.autocrlf true can help, but not on a multi-developpers project.
This command has to be the same on each developper machine, and that's not always the case.
You have to use the .gitattributes provided in the puphpet archive and edit it as follow (carefull, this file need to be in your project root)
You also need to use an IDE that allow you to save/edit files as LF (like phpstorm). You can check the type of the file in the bottom right corner, in the status bar (you'll see LF or CRLF while a file is opened)
@gregsh
gregsh / - IDE Scripting.md
Last active March 13, 2024 03:29
IDE Scripting

Here are my attempts to script an IntelliJ-based IDE using javax.script.* API (ex-JSR-223).

The list of available scripting languages and engines:

  1. Groovy - built-in, via Groovy jars and <app>/lib/groovy-jsr223-xxx.jar
  2. JavaScript (Nashorn) - built-in, via Java Runtime <app>/jbr/... (deprecated and will be removed soon)
  3. JavaScript (GraalJS) - https://plugins.jetbrains.com/plugin/12548-intellij-scripting-javascript
  4. JPython - https://plugins.jetbrains.com/plugin/12471-intellij-scripting-python
  5. JRuby - https://plugins.jetbrains.com/plugin/12549-intellij-scripting-ruby
  6. Clojure - https://plugins.jetbrains.com/plugin/12469-intellij-scripting-clojure
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@daniel-sc
daniel-sc / Item.java
Created October 2, 2014 13:31
Java toString() Parser - creates object/instance from toString() output (-string)
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.log4j.Logger;
@mgedmin
mgedmin / gist:9547214
Created March 14, 2014 12:59
Setting up a Jenkins slave on Linux
# This is how you add a Jenkins slave
# On master:
sudo -u jenkins -H ssh-keygen
# On slave
adduser --system --group --home=/var/lib/jenkins-slave --no-create-home --disabled-password --quiet --shell /bin/bash jenkins-slave
install -d -o jenkins-slave -g jenkins-slave /var/lib/jenkins-slave
@chrismccoy
chrismccoy / gitcheats.txt
Last active April 20, 2024 08:50
git cheats
# alias to edit commit messages without using rebase interactive
# example: git reword commithash message
reword = "!f() {\n GIT_SEQUENCE_EDITOR=\"sed -i 1s/^pick/reword/\" GIT_EDITOR=\"printf \\\"%s\\n\\\" \\\"$2\\\" >\" git rebase -i \"$1^\";\n git push -f;\n}; f"
# edit all commit messages
git rebase -i --root
# clone all your repos with gh cli tool
gh repo list --json name -q '.[].name' | xargs -n1 gh repo clone
@chrisjenx
chrisjenx / .gitignore
Created August 2, 2013 09:57
Java / Gradle / IDEA / Eclipse gitignore
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class