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
| var ptn = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9_.-]+\.[a-zA-Z]+$/; | |
| var email = 'mail@example.com'; | |
| ptn.test(email); // true |
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
| /** | |
| * Recursive listing of all files inside path | |
| * and all files inside of all folders and so on... | |
| * But using stack algorithm instead recursion, which uses less RAM. | |
| * About fs.Stats: | |
| * https://nodejs.org/api/fs.html#fs_class_fs_stats | |
| * @param path - path to root folder | |
| * @param fn - callback function | |
| * @return nothing. | |
| * Expected parameters of the callback functin: |
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
| // TODO: needs to be done | |
| const renameExists = () => { | |
| /** Auto rename a file if the same name exists in a destination folder | |
| * example: file.txt, file(1).txt, file(2).txt | |
| */ | |
| while (exists) { | |
| let filename = exists.title; | |
| let copyNumber = 1; | |
| let ext = ''; |
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
| # Atom sync-settings |
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
| import sys | |
| import os | |
| import random | |
| sys.path.append('/webapps/django/spitekrepko3/') | |
| from django.apps import apps | |
| from django.core.wsgi import get_wsgi_application | |
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
| #!/bin/bash | |
| IPT='/sbin/iptables' | |
| IPSET='/sbin/ipset' | |
| IP=$(ifconfig eth0 | grep "inet addr" | cut -d ':' -f 2 | cut -d ' ' -f 1) | |
| ipset_trust=$(cat /root/ipset_trust.txt) | |
| ipset_blacklist=$(cat /root/ipset_blacklist.txt) | |
| $IPT -F | |
| $IPT -t raw -F |
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
| [global] | |
| netbios name = Apps | |
| security = USER | |
| #======================= Networking ======================= | |
| socket options = TCP_NODELAY IPTOS_LOWDELAY | |
| local master = yes | |
| time server = yes | |
| read size - 4096 | |
| os level = 65 |
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
| port_range = 40890-40890 | |
| port_random = no | |
| check_hash = yes | |
| directory = /usb_hdd/rtorrent-tmp | |
| session = /usb_hdd/rtorrent-session | |
| encoding_list = UTF-8 | |
| encryption = allow_incoming,enable_retry,prefer_plaintext | |
| schedule = watch_directory,5,5,load_start=/home/titovanton/shared/*.torrent | |
| schedule = low_diskspace,5,60,close_low_diskspace=100M | |
| upload_rate = 0 |
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
| #! /bin/bash | |
| # Put that script in to the /usr/local/bin/gl - without .sh | |
| # Then give +x permissions | |
| if [ -z $1 ] | |
| then | |
| PARAM=-10 | |
| else | |
| PARAM=$1 | |
| fi |
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
| #! /bin/bash | |
| # Put that script in to the /usr/local/bin/dnr - without .sh | |
| # Then give +x permissions | |
| docker rmi -f $(docker images -f dangling=true -q) |
OlderNewer