Source : https://github.com/awesome-selfhosted/awesome-selfhosted
Filtering lightweight results only
Source : https://github.com/awesome-selfhosted/awesome-selfhosted
Filtering lightweight results only
| # bash pyunused.sh filename.py | |
| s=$(cat $1 | grep import | grep as | awk '{print $4}') | |
| t=$(cat $1 | grep import | grep -v as | awk '{print $2}') | |
| echo "Following unused packages" | |
| echo "-------------------------" | |
| for el in $s; do | |
| count=$(cat $1 | grep $el | wc -l) | |
| if (( ${count} == 1 )); then |
| # User input variables | |
| max_files=20 #No of files to List | |
| scandirs="./scan-dirs.txt" #list of directories separated by newline to scan | |
| ignore_files="./ignore-files.txt" #non-deleted files path will be stored here to avoid re-appearing | |
| # Program Tests | |
| test -f $scandirs || touch $scandirs | |
| test -f $ignore_files || touch $ignore_files |
| #/etc/wpa_supplicant/wpa_supplicant.conf | |
| ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev | |
| update_config=1 | |
| country=IN | |
| network={ | |
| ssid="" | |
| psk="" | |
| key_mgmt=WPA-PSK |
| <?php | |
| $filename = 'filename.json'; | |
| //decode to json as associative array | |
| $data = json_decode(file_get_contents($filename),true); | |
| //init condition in case of empty file | |
| if (!is_array($data)){ | |
| $data = []; | |
| } |
| --- | |
| layout: post | |
| title: Test | |
| date: 2020-02-02 | |
| category: Solutions,SoftwareDiscovery,Notes | |
| author: Peeyush Singh | |
| --- |
| source="*.py" | |
| funcs=$(cat $source | grep 'def' | sed 's/def //g' | sed 's/(.*/(/' | grep -v '#') | |
| for f in $funcs | |
| do | |
| echo $f $(expr $(cat $source | grep -c $f) - 1) | |
| done |
| sudo nano /lib/systemd/system/sample.service | |
| Add in the following text : | |
| [Unit] | |
| Description=My Sample Service | |
| After=multi-user.target | |
| [Service] | |
| Type=idle |
| # python 3 | |
| import os | |
| import hashlib | |
| import shutil | |
| def md5(fname): | |
| hash_md5 = hashlib.md5() | |
| with open(fname, "rb") as f: | |
| for chunk in iter(lambda: f.read(4096), b""): | |
| hash_md5.update(chunk) |
| invoice: 34843 | |
| date : 2001-01-23 | |
| bill-to: &id001 | |
| given : Chris | |
| family : Dumars | |
| address: | |
| lines: | | |
| 458 Walkman Dr. | |
| Suite #292 | |
| city : Royal Oak |