Menu Close

Category: Code

Two new scripts on GitHub

I’ve published two new PowerShell scripts on GitHub: https://github.com/obs0lete/Grant-Admin – Used for grant local administrator rights on remove machine. https://github.com/obs0lete/Revoke-Admin – Used to revoke administrator rights on remote machines. I will (slowly) be adding a bunch of my scripts on my GitHub repo: https://github.com/obs0lete Enjoy!

Weather information in Powershell console – Updated

With inspiration from https://www.reddit.com/r/PowerShell/comments/3zf0b8/getweather_get_the_current_weather_of_your/ and http://wttr.in/ I’ve written a function for Powershell where you can get current weather conditions whenever you launch the console! Make sure to add this function to your Powershell profile and call it via Get-Weather to have it automatically run. You can find the script on…

MiniDLNA paths in OpenWRT

I’ve recently made the switch from using DD-WRT to OpenWRT (https://openwrt.org/) which is essentially what DD-WRT is based on. I now have a much leaner, cleaner and more control over my router. One thing that has bugged me was that I decided to enable MiniDLNA on the router but was…

Customizing Linux Shell

Just a quick post on customizing the Linux Shell. My host is in CST and I wanted to change my timezone to EST. After some research, I found that we can make changes to the .bashrc file to set certain environmental settings. I also found out I could change a…

Delete files older than X days

Here’s a quick portion of a PowerShell script I used that will delete files older than X dates from the current date. 123 $path = “path-to-folder”$days= (Get-Date).AddDays(-7)Get-ChildItem -Path $path -Force | Where-Object { !$_.PSIsContainer -and $_.CreationTime -lt $days} | Remove-Item -Force Simply change $days to the number of days. In…