Skip to content

Instantly share code, notes, and snippets.

View gorshkov-leonid's full-sized avatar

Leonid Gorshkov gorshkov-leonid

View GitHub Profile
@gorshkov-leonid
gorshkov-leonid / links.md
Last active August 7, 2021 20:57 — forked from scue/shell_pack.sh
pack a shell script and its depending files as a single executable file
package com.netcracker.dstud.servicepackage.service.specification;

import java.util.concurrent.*;
import java.util.function.*;

public class M
{
    public static void main(String[] args)
    {
@gorshkov-leonid
gorshkov-leonid / downloadAttachment.js
Created June 8, 2020 21:23
Download file with content disposition attachment
function downloadFile(url) {
var loaded = $.Deferred();
var request = new XMLHttpRequest();
request.open('GET', url);
// ! setting the responseType has to be after the `request.open`
// `arraybuffer` is necessary for Internet Explorer and Edge becuase
// they do not support `blob` as response type
request.responseType = "arraybuffer";
request.onload = function() {
git config --global pull.rebase preserve
for num in {1..3}; do
mkdir "$num"
cd "$num"
git clone "https://aaa.git" .
cd ".."
done
https://www.rust-lang.org/tools/install
https://stackoverflow.com/questions/47379214/step-by-step-instruction-to-install-rust-and-cargo-for-mingw-with-msys2
1) rustup-init.exe
2) customize installation -> Default host triple? x86_64-pc-windows-gnu
or
2) default installation and then `rustup toolchain install stable-x86_64-pc-windows-gnu && rustup default stable-x86_64-pc-windows-gnu`
https://github.com/rust-lang/rls (rust language server)
3) `rustup update && rustup component add rls rust-analysis rust-src`
#add separate repo list and update
RUN sudo touch /etc/apt/sources.list.d/myrepo.list
RUN sudo /bin/bash -c 'echo "deb http://myrepo.corp/deb/ubuntu $(lsb_release -cs) main" >> /etc/apt/sources.list.d/myrepo.list'
RUN sudo /bin/bash -c 'echo "# deb-src myrepo.corp/deb/ubuntu $(lsb_release -cs) main" >> /etc/apt/sources.list.d/myrepo.list'
RUN sudo apt-get update -y -o Dir::Etc::sourcelist="sources.list.d/myrepo.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" || true
#add to global repos list
deb http://myrepo.corp/deb/ubuntu $(lsb_release -cs) main
ps -auxww | grep -i 6800 поиск pid
jcmd <pid> GC.run вызов GC
jmap -dump:live,format=b,file=filename <pid> Сохранение дампа
#remove all containers
docker rm -f $(docker ps -a -q)
#al images
docker rmi -f $(docker images -q)
#remove all containers / images / volumes - dangling (not associated with a container)
docker system prune
#remove all
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
export default {
input: 'index.js',
output: {
file: 'dist/pretty-ms-5.0.0.js',
format: 'umd',
name: 'prettyMilliseconds',
},