mirror of
https://gitea.blesmrt.net/mikaela/scripts.git
synced 2025-08-19 04:47:20 +02:00
Compare commits
No commits in common. "68bbafe5f36eca36664163503a7b95fbf9d4c59d" and "32d843fc2792eefbf70550f9704c1474b177d74f" have entirely different histories.
68bbafe5f3
...
32d843fc27
@ -9,12 +9,3 @@ charset = utf-8
|
|||||||
indent_style = tab
|
indent_style = tab
|
||||||
indent_size = tab
|
indent_size = tab
|
||||||
#tab_width =
|
#tab_width =
|
||||||
|
|
||||||
[*.{cff,yaml,yml}]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[*.{txt,markdown,md}]
|
|
||||||
trim_trailing_whitespace = false
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
# Remember to run `pre-commit install` at least once!
|
|
||||||
# Manual test run: `pre-commit run --all-files`
|
|
||||||
# Update? `pre-commit autoupdate`
|
|
||||||
#
|
|
||||||
# See https://pre-commit.com for more information
|
|
||||||
# See https://pre-commit.com/hooks.html for more hooks
|
|
||||||
repos:
|
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
||||||
rev: v4.4.0
|
|
||||||
hooks:
|
|
||||||
- id: check-case-conflict
|
|
||||||
- id: check-executables-have-shebangs
|
|
||||||
- id: check-shebang-scripts-are-executable
|
|
||||||
- id: destroyed-symlinks
|
|
||||||
- id: detect-private-key
|
|
||||||
- id: end-of-file-fixer
|
|
||||||
- id: fix-byte-order-marker
|
|
||||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
|
||||||
rev: "v3.0.0-alpha.4"
|
|
||||||
hooks:
|
|
||||||
- id: prettier
|
|
||||||
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
|
|
||||||
rev: "2.7.1"
|
|
||||||
hooks:
|
|
||||||
- id: editorconfig-checker
|
|
||||||
alias: ec
|
|
16
README.md
16
README.md
@ -11,12 +11,12 @@ through curl/wget.
|
|||||||
|
|
||||||
### Directories
|
### Directories
|
||||||
|
|
||||||
- _bash_ has just normal bash scripts
|
* *bash* has just normal bash scripts
|
||||||
- _nodejs_ **MIGHT** get some nodejs scripts
|
* *nodejs* **MIGHT** get some nodejs scripts
|
||||||
- _WeeChat_ is a placeholder and unlikely to get anything.
|
* *WeeChat* is a placeholder and unlikely to get anything.
|
||||||
- _ZNC_ is another placeholder which is unlikely to get anything.
|
* *ZNC* is another placeholder which is unlikely to get anything.
|
||||||
- note that they are _modules_ with ZNC, but I don't see why I
|
* note that they are *modules* with ZNC, but I don't see why I
|
||||||
couldn't put them here.
|
couldn't put them here.
|
||||||
|
|
||||||
_I doubt I am going to write many WeeChat scripts or ZNC modules, so I
|
*I doubt I am going to write many WeeChat scripts or ZNC modules, so I
|
||||||
won't be making subdirectories for different languages._
|
won't be making subdirectories for different languages.*
|
||||||
|
@ -1,24 +1,26 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
// Require the dns module
|
// Require the dns module
|
||||||
var dns = require("dns");
|
var dns = require('dns');
|
||||||
|
|
||||||
// Function for IPv4
|
// Function for IPv4
|
||||||
var myip4 = function () {
|
var myip4 = function () {
|
||||||
// Set DNS servers to OpenDNS IPv4
|
// Set DNS servers to OpenDNS IPv4
|
||||||
var servers4 = dns.setServers(["208.67.222.222", "208.67.220.220"]);
|
var servers4 = dns.setServers(["208.67.222.222", "208.67.220.220"])
|
||||||
|
|
||||||
// Check where myip.opendns.com resolves to and I think this is a
|
// Check where myip.opendns.com resolves to and I think this is a
|
||||||
// function that takes arguments err and addresses.
|
// function that takes arguments err and addresses.
|
||||||
dns.resolve4("myip.opendns.com", function (err, addresses) {
|
dns.resolve4('myip.opendns.com', function (err, addresses) {
|
||||||
// if err contains a truthy value, an error has occurred
|
|
||||||
if (err) throw err;
|
|
||||||
|
|
||||||
// Print the first thing in array addresses as it has our IPv4
|
// if err contains a truthy value, an error has occurred
|
||||||
// address.
|
if (err) throw err;
|
||||||
console.log(addresses[0]);
|
|
||||||
});
|
// Print the first thing in array addresses as it has our IPv4
|
||||||
};
|
// address.
|
||||||
|
console.log(addresses[0]);
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// IPv6 part is broken because of node bug.
|
// IPv6 part is broken because of node bug.
|
||||||
// https://github.com/nodejs/node/issues/894
|
// https://github.com/nodejs/node/issues/894
|
||||||
|
Loading…
x
Reference in New Issue
Block a user