This file contains hidden or 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
| # -- coding: utf-8 -- | |
| # MIT License | |
| # | |
| # Copyright (c) 2020 Charles Jekel (cj@jekel.me) | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| # copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or 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
| from glob import glob | |
| files = glob('*.ovpn') | |
| for myfile in files: | |
| with open(myfile, 'r') as f: | |
| my_txt = f.read() | |
| my_txt = my_txt.replace('client', 'client\nscript-security 2 \nup /etc/openvpn/client.up\ndown /etc/openvpn/client.down', 1) | |
| with open(myfile, 'w') as f: | |
| f.write(my_txt) |
This file contains hidden or 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
| from glob import glob | |
| files = glob('*.ovpn') | |
| for myfile in files: | |
| with open(myfile, 'r') as f: | |
| my_txt = f.read() | |
| my_txt = my_txt.replace('auth-user-pass', 'auth-user-pass /etc/openvpn/pass.txt') | |
| with open(myfile, 'w') as f: | |
| f.write(my_txt) |
This file contains hidden or 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
| rem http://winteltools.com/directory-size/ | |
| ls | add-member -force -PassThru -name length -type scriptproperty -value { ls $this -Recurse -force | Measure-Object length -Sum | select -ExpandProperty sum } | Sort-Object length -Descending | Format-Table Name, @{label=“length”; expression={$_.length/1GB}; f=“{0:N2}”} -autosize |
This file contains hidden or 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
| # Get started with OpenSuse in a VM VirtualBox | |
| # OpenSuse just doesn't work in a virtual box, follow this and it will work | |
| # installing the guest additions from VM 5.0.20 doesn't work | |
| # the auto run script from guest additions also won't work | |
| # From https://forums.opensuse.org/showthread.php/502328-13-2-Virtualbox-guest-and-shared-folders-in-media thanks to jetchisel | |
| # Create /media and assign permissions | |
| mkdir /media | |
| chmod o+rw /media |