Skip to content

Instantly share code, notes, and snippets.

View pandeyvinod's full-sized avatar
🏠
Working from home

Vinod pandeyvinod

🏠
Working from home
  • Remote
  • India
View GitHub Profile
@pcanham
pcanham / gist:9157b72ebf35d1f1fbf5051f5e208dd6
Created August 2, 2019 13:18
packer example for amazon linux 2
{
"min_packer_version": "1.4.2",
"variables": {
"ami_name": "basebuild-amzn-linux2-{{isotime \"2006-01-02_15:04\"}}",
"aws_region": "eu-west-1",
"aws_profile": "aws-profile",
"aws_tag_COST_CENTER": "COSTCENTER",
"aws_tag_BUSINESS": "IT",
"aws_tag_ENVIRONMENT": "NON-PRODUCTION",
"aws_tag_OWNER": "OWNER-TAG",
@jonico
jonico / Jenkinsfile
Last active May 11, 2024 09:58
Example for a full blown Jenkins pipeline script with CodeQL analysis steps, multiple stages, Kubernetes templates, shared volumes, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, Docker containers, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, …
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(label: label, yaml: """
spec:
containers:
- name: mvn
image: maven:3.3.9-jdk-8

Recovering deleted files in Ubuntu with ext4 filesystem

Recently, I deleted some files by mistake in a Ubuntu machine with an ext4 fs. These notes document the steps I took to get them back.

Important

  • this procedure assumes that the partition that contained the deleted files is different from the root partition, as that was the scenario with which I had to deal (deleted files were in my home dir). The procedure needs that the partition that contained the files is unmounted, so if the deleted files were in the root partition, the process would be a bit different (e.g. storing the fs journal in a USB stick, using a live CD/USB to boot and issue the commands, etc.)
  • if something is not clear, you need more information, etc. check the sources below

With that out the way, let's begin.

@davfre
davfre / git_cheat-sheet.md
Last active July 23, 2024 04:43
git commandline cheat-sheet