Skip to content

Instantly share code, notes, and snippets.

View devenes's full-sized avatar
☁️

Enes devenes

☁️
View GitHub Profile
autoload -U +X bashcompinit && bashcompinit
zmodload -i zsh/parameter
if ! (( $+functions[compdef] )) ; then
autoload -U +X compinit && compinit
fi
_python_argcomplete() {
local prefix=
if [[ $COMP_LINE == 'gcloud '* ]]; then
if [[ $3 == ssh && $2 == *@* ]] ;then
@devenes
devenes / README.md
Last active March 24, 2023 22:25 — forked from nordineb/README.md
Hide HTTP Headers - Fingerprinting Web Server

Checking HTTP headers with CURL

curl -I -L https://hostname

Remove ASP.Net MVC Default HTTP Headers

Global.asax.cs

@devenes
devenes / chrome.ps1
Created March 19, 2023 15:37
Install Google Chrome on Windows Server
$LocalTempDir=$env:TEMP;$ChromeInstaller="ChromeInstaller.exe";(New-Object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe',"$LocalTempDir\$ChromeInstaller");Start-Process -FilePath "$LocalTempDir\$ChromeInstaller" -ArgumentList '/silent', '/install' -Wait;$Process2Monitor="chrome";Do{$ProcessesFound=Get-Process -Name $Process2Monitor -ErrorAction SilentlyContinue;if($ProcessesFound){Write-Host "Still running: $($ProcessesFound.Name -join ', ')";Start-Sleep -Seconds 2}else{Remove-Item -Path "$LocalTempDir\$ChromeInstaller" -ErrorAction SilentlyContinue -Verbose}}until(!$ProcessesFound)$LocalTempDir=$env:TEMP;$ChromeInstaller="ChromeInstaller.exe";(New-Object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe',"$LocalTempDir\$ChromeInstaller");Start-Process -FilePath "$LocalTempDir\$ChromeInstaller" -ArgumentList '/silent', '/install' -Wait;$Process2Monitor="chrome";Do{$ProcessesFound=Get-Process -Name $Proce
# Use a multi-stage build to optimize image size
FROM node:14-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
FROM nginx:alpine
LABEL maintainer="Your Name <youremail@example.com>"
@devenes
devenes / main.tf
Created November 30, 2022 14:46
Infrastructure as Code with Terraform
terraform {
required_providers {
google = {
source = "hashicorp/google"
}
}
}
provider "google" {
version = "3.5.0"
resource "google_compute_instance" "terraform" {
project = "<PROJECT_ID>"
name = "terraform"
machine_type = "n1-standard-1"
zone = "us-west1-c"
boot_disk {
initialize_params {
image = "debian-cloud/debian-11"
}
@devenes
devenes / treminal.sh
Created November 7, 2022 14:31
Customizing Terminal Colors
# Customizing Terminal Colors
#
# export PS1='\[\033[1;36m\]\u\[\033[1;31m\]@\[\033[1;32m\]\h:\[\033[1;35m\]\w\[\033[1;31m\]\$\[\033[0m\]'
cyan='\[\033[1;36m\]'
red='\[\033[1;31m\]'
green='\[\033[1;32m\]'
purple='\[\033[1;35m\]'
reset='\[\033[0m\]'
@devenes
devenes / tekton_demo.md
Last active November 3, 2022 18:32
tekton_demo.md
brew install cosign
brew install crane
kind create cluster --image=kindest/node:v1.24.0
i=0
while test 1==1
do
remote_ip=10.25.10.10
remote_user=enes
local_port=22
exist=`ps aux | grep $remote_user@$remote_ip | grep $local_port`
if test -n "$exist"
then
Q: Create a job that calculates pi to 2000 decimal points using the container with the image named perl
and the following commands issued to the container: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
Once the job has completed, check the logs to and export the result to pi-result.txt.
Solution:
kc job pi2000 --image=perl -o yaml --dry-run > pi2000.yaml
### edit the file, edit the name, remove any ID references and include the command argument under container spec.