Skip to content

Instantly share code, notes, and snippets.

View PathriK's full-sized avatar

Keerthi Kumar P PathriK

View GitHub Profile
@PathriK
PathriK / ddrescue
Created December 21, 2020 15:36
Commands used to run ddrescue
ddrescue -d -n -N -v /dev/sde /media/pathrik/Backup Plus/2TB Bkup/mypassport.img mypassport_merge.logfile
ddrescue -d -r3 -v /dev/sde /media/pathrik/Backup Plus/2TB Bkup/mypassport.img mypassport_merge.logfile
ddrescue -d -r3 -R -v /dev/sde /media/pathrik/Backup Plus/2TB Bkup/mypassport.img mypassport_merge.logfile
/dev/sde --> Drive that is not getting recognized(source)
/media/pathrik/Backup Plus/2TB Bkup/mypassport.img --> Location where the above drives cloned image should be written to (target)
mypassport_merge.logfile -->file that stores the progress so that we can stop and resume as needed
The first command does a clone of sectors that it can read quickly. It skips sectors it is not able read.
Second command does extra work to clone of skipped sections from previous command
@PathriK
PathriK / UpdateVersionFromPom.ps1
Last active January 5, 2017 02:53
Appveyor Build Version from Maven pom.xml
$env:POM_VERSION = ([xml](Get-Content .\pom.xml)).project.version
Update-AppveyorBuild -Version "$env:POM_VERSION.$env:APPVEYOR_BUILD_NUMBER"
$token = $env:API_TOKEN #should be defined as scure variable
$headers = @{
"Authorization" = "Bearer $token"
"Content-type" = "application/json"
}
$apiURL = "https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG"
$history = Invoke-RestMethod -Uri "$apiURL/history?recordsNumber=2" -Headers $headers -Method Get