Skip to content

Instantly share code, notes, and snippets.

View akoken's full-sized avatar
:octocat:
Predicts the future with computers.

Abdurrahman Alp Köken akoken

:octocat:
Predicts the future with computers.
View GitHub Profile
@akoken
akoken / project-layout.md
Created January 29, 2024 11:38
New Project Structure
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
  tests/
 .editorconfig
@akoken
akoken / base-chiselled-ubuntu.md
Created December 26, 2023 22:07
Base Ubuntu Chisel docker image
ARG UBUNTU_RELEASE=22.04
ARG ARCH

# Build the chiselled filesystem based on the desired slices.
FROM ubuntu:$UBUNTU_RELEASE AS builder
ARG UBUNTU_RELEASE
ARG ARCH

# Get chisel binary
@akoken
akoken / rust-chiselled-dockerfile.md
Last active January 7, 2024 17:56
Smaller distroless Ubuntu Chiselled docker image for Rust
FROM rust:1.74.1 as APP_PLANNER
WORKDIR /usr/local/src
RUN cargo install cargo-chef
COPY . .
RUN cargo chef prepare --recipe-path recipe.json

FROM rust:1.74.1 as APP_CACHER
WORKDIR /usr/local/src
RUN cargo install cargo-chef
using ErrorOr;
using Microsoft.AspNetCore.Mvc;
using ZiggyCreatures.Caching.Fusion;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var redisConnectionString = builder.Configuration.GetValue<string>("RedisCachingConnectionString");
docker run --name adguardhome\
    --restart unless-stopped\
    -v /my/own/workdir:/opt/adguardhome/work\
    -v /my/own/confdir:/opt/adguardhome/conf\
    -p 53:53/tcp -p 53:53/udp\
    -p 67:67/udp -p 68:68/udp\
    -p 80:80/tcp -p 443:443/tcp -p 443:443/udp -p 3000:3000/tcp\
    -p 853:853/tcp\
 -p 784:784/udp -p 853:853/udp -p 8853:8853/udp\
@akoken
akoken / commit-template.txt
Last active March 7, 2022 10:17
Git Commit Template
##################################################
# Write a title summarizing what this commit does.
# Start with an uppercase imperative verb, such as
# Add, Drop, Fix, Refactor, Bump; see ideas below.
# Think of your title as akin to an email subject,
# so you don't need to end with a sentence period.
# Use 50 char maximum, which is this line's width.
##################################################
Add your title here
@akoken
akoken / top-linux-commands.txt
Last active March 6, 2022 22:53
Top 50 Linux Commands
ls – The most frequently used command in Linux to list directories
pwd – Print working directory command in Linux
cd – Linux command to navigate through directories
mkdir – Command used to create directories in Linux
mv – Move or rename files in Linux
cp – Similar usage as mv but for copying files in Linux
rm – Delete files or directories
touch – Create blank/empty files
ln – Create symbolic links (shortcuts) to other files
cat – Display file contents on the terminal
@akoken
akoken / ca.ruleset
Last active March 7, 2022 05:54
Coding Standards StyleCop Analyzer Rulesets
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Custom Rulset" Description="Custom Rulset" ToolsVersion="14.0">
<Rules AnalyzerId="AsyncUsageAnalyzers" RuleNamespace="AsyncUsageAnalyzers">
<Rule Id="UseConfigureAwait" Action="Warning" />
</Rules>
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
<Rule Id="CA1001" Action="Warning" />
<Rule Id="CA1009" Action="Warning" />
<Rule Id="CA1016" Action="Warning" />
<Rule Id="CA1033" Action="Warning" />
@akoken
akoken / Microsoft.PowerShell_profile.ps1
Created November 1, 2021 09:49
PowerShell Profile
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
$global:DefaultUser = [System.Environment]::UserName
Import-Module posh-git
Import-Module oh-my-posh
Import-Module 'terminal-icons'
#Set-PoshPrompt -Theme slim
Set-PoshPrompt -Theme ~/Documents/PowerShell/blue-owl.omp.json
#Set-PoshPrompt -Theme ~/Documents/PowerShell/ohmyposh.json