Skip to content

Instantly share code, notes, and snippets.

View krasnobaev's full-sized avatar
👨‍🔬

Aleksey Krasnobaev krasnobaev

👨‍🔬
View GitHub Profile
@krasnobaev
krasnobaev / setup.sh
Last active March 30, 2018 19:46
setup script
#!/bin/bash
apt install -Y git zsh wget openssh
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
echo "set -g @plugin 'tmux-plugins/tpm'" >> ~/.tmux.conf
echo "set -g @plugin 'tmux-plugins/tmux-sensible'" >> ~/.tmux.conf
echo "run '~/.tmux/plugins/tpm/tpm'" >> ~/.tmux.conf
@krasnobaev
krasnobaev / homedirectoryforuser.js
Last active July 8, 2018 19:47 — forked from TooTallNate/objc.js
Experimentations with node-ffi
// https://developer.apple.com/documentation/foundation/nsfilemanager/1642853-homedirectoryforuser
var ffi = require('ffi');
var objc = new ffi.Library(null, {
'objc_getClass': [ 'pointer', [ 'string' ] ],
'sel_registerName': [ 'pointer', [ 'string' ] ],
'objc_msgSend': [ 'pointer', [ 'pointer', 'pointer' ] ]
});
var objc2 = new ffi.Library(null, {
'objc_msgSend': [ 'string', [ 'pointer', 'pointer' ] ]
});
@krasnobaev
krasnobaev / main.md
Last active May 16, 2019 18:17
talk-2019-wasmjsbundlers
@krasnobaev
krasnobaev / deploy.bash
Last active March 6, 2020 07:32
hana express deployment
SOURCE https://developers.sap.com/tutorials/hxe-ua-install-using-docker.html
# Step 4: Download the SAP HANA, express edition Image from the Docker Library
```bash
docker login
docker pull store/saplabs/hanaexpressxsa:2.00.045.00.20200121.1
```
# Step 5: Edit the host sysctl.conf file and reboot to apply changes
```bash
// Hello world! Cplayground is an online sandbox that makes it easy to try out
// code.
#include <iostream>
#include <stdlib.h>
#include <math.h>
#include <time.h>
using namespace std;
@krasnobaev
krasnobaev / .gitconfig
Last active October 24, 2024 21:34
Basic server env
[init]
defaultBranch = main
[user]
email = [email protected]
name = User Name
[alias]
set-upstream = !git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD`
[push]
autoSetupRemote = true
[credential]
@krasnobaev
krasnobaev / list.sh
Created April 26, 2023 15:46
generate source code listing
#!/bin/sh
# usage: scriptname file1 file2 ...
# find . -name '*' | sort | xargs ./list.sh {} \; > ../listing.txt
for file in "$@"
do
[ -f "$file" ] || continue
set -- `wc "$file"`
echo "${file}: lines $1 words $2 bytes $3"
cat -b -t "$file"
@krasnobaev
krasnobaev / auth.vbs
Created June 10, 2024 02:11
microsoft VBS user automation
set shell=wscript.createobject("Wscript.shell")
Wscript.Sleep 3000
shell.sendkeys "user_name"
Wscript.Sleep 500
shell.sendkeys "{TAB}"
Wscript.Sleep 500
shell.sendkeys "pass_word"
Wscript.Sleep 500
shell.sendkeys "{ENTER}"
#![warn(
clippy::all,
clippy::restriction,
clippy::pedantic,
clippy::nursery,
// clippy::cargo,
)]
#![allow(clippy::missing_docs_in_private_items)]
#![allow(clippy::print_stdout)]
#![allow(clippy::print_stderr)]
@krasnobaev
krasnobaev / docker.yml
Created October 22, 2024 22:48
cloud-init
#cloud-config
packages:
- docker.io
groups:
- docker
system_info:
default_user:
groups: [docker]