This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
apt-get update | |
apt-get dist-upgrade -y | |
apt-get autoclean | |
#place the preceding lines into a file in your cron.daily folder e.g. | |
#sudo nano /etc/cron.daily/auto-dist-upgrade | |
#sudo chmod 755 /etc/cron.daily/auto-dist-upgrade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
My C# and VB.net project files contain many lines | |
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | |
and I want them to say | |
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |
so the gist of it is | |
find -regex '.*\.vbproj\|.*\.csproj' -exec sed --in-place --binary 's:<CopyToOutputDirectory>Always</CopyToOutputDirectory>:<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>:' {} \; | |
Explaination: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Try | |
'Try and save your file | |
document_pdf.Save(FileName) | |
document_pdf.Dispose() | |
Catch ex As System.IO.IOException | |
'ok it failed, probably because it's open somewhere else | |
'starting it here will bring it to the front of whatever is running it | |
Process.Start(FileName) | |
Dim AllProcesses = Process.GetProcesses | |
For Each proc In AllProcesses |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os | |
files = [f for f in os.listdir('.') if os.path.isfile(f)] | |
shortcut = ' - Shortcut.lnk' | |
for f in files: | |
if f[-len(shortcut):] == shortcut: | |
print(f, f[:-len(shortcut)]+'.lnk') | |
os.rename(f, f[:-len(shortcut)]+'.lnk') | |