Skip to content

Instantly share code, notes, and snippets.

View Kukunin's full-sized avatar

Sergiy Kukunin Kukunin

View GitHub Profile
@Kukunin
Kukunin / claude.code.txt
Last active July 25, 2025 14:45
Claude Code prompt
You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
IMPORTANT: Assist with defensive security tasks only. Refuse to create, modify, or improve code that may be used maliciously. Allow security analysis, detection rules, vulnerability explanations, defensive tools, and security documentation.
IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.
If the user asks for help or wants to give feedback inform them of the following:
- /help: Get help with using Claude Code
- To give feedback, users should report the issue at https://github.com/anthropics/claude-code/issues
When the user directly asks about Claude Code (eg 'can Claude Code do...', 'does Claude Code have...') or asks in second person (eg 'are you able...', 'can you do...'), first use
@Kukunin
Kukunin / ubuntu-resize-rootfs.sh
Created June 21, 2025 04:36 — forked from ba0f3/ubuntu-resize-rootfs.sh
resize rootfs with out need of LiveCD (w/ or w/o LVM) - need to reboot once.
#!/bin/bash
#
# Resize root filesystem during boot.
#
# Alternative: http://www.ivarch.com/blogs/oss/2007/01/resize-a-live-root-fs-a-howto.shtml
# New size of root filesystem
ROOT_SIZE="100G"
# Check current filesystem type
@Kukunin
Kukunin / ractors.rb
Last active April 5, 2025 11:00
Ruby Ractors vs Threads benchmark
require 'benchmark'
require 'etc'
Ractor.new { :warmup } if defined?(Ractor)
def fibonacci(n)
return n if (0..1).include? n
fibonacci(n - 1) + fibonacci(n - 2)
end
@Kukunin
Kukunin / hierarchy_spec.rb
Last active April 9, 2020 10:49
A test to create a tree of elements
require 'rails_helper'
RSpec.describe 'hierarchy' do
subject(:hierarchy) { create_hierarchy(per_level: 3, levels: 5) }
def create_element(type, children)
{ type: type, children: children }
end
# Take a pen and piece of paper
@Kukunin
Kukunin / myTransformation.js
Last active May 28, 2022 21:48
A template for a typical transformation for gulp
const through = require('through2'),
PluginError = require('gulp-util').PluginError;
module.exports = function myTransformation(options) {
if(!options) {
options = {};
}
return through.obj(function (file, enc, cb) {
if (file.isNull()) {
@Kukunin
Kukunin / websocket.js
Created December 9, 2017 19:49
Simulate a TCP socket with `ws` in NOMP based pools
var events = require('events');
var ws = require('ws');
function simulateTcpSocketFromWS(ws) {
var socket = {};
socket.remoteAddress = ws._socket.remoteAddress;
socket.localPort = ws._socket.localPort;
@Kukunin
Kukunin / Dockerfile
Created November 3, 2017 10:47
Dockerfile along with docker-compose.yml for a typical phoenix 1.3 elixir application
FROM elixir:1.5
MAINTAINER Sergiy Kukunin <[email protected]>
RUN wget -qO- https://deb.nodesource.com/setup_8.x | bash - && \
apt-get install -y nodejs
RUN mix local.rebar
RUN mix local.hex --force
WORKDIR /app
ENV MIX_ENV prod
@Kukunin
Kukunin / push_git_to_server.sh
Created November 3, 2017 09:02
How to upload git repo to the server directly without a intermediate repository
# We are in a folder with local git repository
pwd
# We need to create an empty repo on the server
# We want to checkout another branch because
# git prevents you from pushing to the current checked branch, which is master by default
ssh <user>@<host> 'mkdir repo && cd repo && git init && git checkout -b local'
# Add remote repo
git remote add server <user>@<host>:repo
@Kukunin
Kukunin / my_grape_api.rb
Last active November 24, 2022 12:31
Ruby Grape API authorization with Pundit example, without any extra gems
class MyGrapeAPI < Grape::API
helpers Pundit
after { verify_authorized }
helpers do
def current_user
nil # your authentication mechanism
end
end

Keybase proof

I hereby claim:

  • I am kukunin on github.
  • I am kukunin (https://keybase.io/kukunin) on keybase.
  • I have a public key ASBOPhHWzAZdYPXlRSQQD3t99sxWUJ2YcOnvIcPZNStyzwo

To claim this, I am signing this object: