Skip to content

Instantly share code, notes, and snippets.

View onuralp's full-sized avatar
🖖

Onuralp Taner onuralp

🖖
View GitHub Profile
@onuralp
onuralp / recover-files-from-a-corrupted-disk-on-macos.md
Last active January 6, 2024 16:48
Rescue your data from a corrupted hard drive on macOS

Recover files from corrupted external hard drive on MacOS

The error:

macOS can't repair the disk BLA
You can still open or copy files on the disk, but you can’t save changes to files on the disk. Back up the disk and reformat it as soon as you can.

The solution:

@onuralp
onuralp / update-cloudwatch-retentionpolicies.sh
Last active August 26, 2021 20:28
Update all AWS CloudWatch log groups retention policies with AWS CLI
#!/bin/bash
echo xxxxxxxxxxxxxxxxxxxxxx Updating Retention Policies xxxxxxxxxxxxxxxxxxxxxx
RETENTION_IN_DAYS=14
AWS_REGION=us-west-2
LOG_GROUPS=$(aws logs describe-log-groups --region $AWS_REGION | jq --raw-output '.logGroups|.[]?|.logGroupName')
for logGroup in $LOG_GROUPS
do
echo EXECUTING: "Updating retention policy for ${logGroup} with ${RETENTION_IN_DAYS} day(s)"
@onuralp
onuralp / Jenkinsfile
Last active January 6, 2021 17:43
Jenkins Shared lib function for VSTest Test Runner and Code Coverage Report
#!groovy
// I suggest you to add those functions as Shared Library https://jenkins.io/doc/book/pipeline/shared-libraries/
@Library('your-shared-lib') _
pipeline {
stages {
//..
stage('Run Unit Tests') {
steps {
@onuralp
onuralp / install-kubectl-helm-ubuntu.sh
Created August 1, 2017 08:22
This script installs kubectl kubectx and helm to you ubuntu. I usually use docker to connect kubectl. But I created this for some reason. Enjoy
# update
sudo apt-get update
sudo apt-get -qq update
# Install kubectl
sudo curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
sudo chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
# Install kubectx (Switch between Kubernetes contexts/namespaces)
@onuralp
onuralp / marvel-ch.sh
Last active May 22, 2017 09:52
Marvel Character slug names for bash
#!/bin/bash
set -e
# Gets a marvel-charecter slug
NAME=$(marvel-characters)
# For MacOS
echo "$NAME" | iconv -t ascii//TRANSLIT | sed -E s/[^a-zA-Z0-9]+/-/g | sed -E s/^-+\|-+$//g | tr A-Z a-z

Keybase proof

I hereby claim:

  • I am onuralp on github.
  • I am onuralptaner (https://keybase.io/onuralptaner) on keybase.
  • I have a public key whose fingerprint is BABA 6DF2 F454 EE1B F9E1 CFD5 742B 2458 45D4 5416

To claim this, I am signing this object: