Search This Blog

Friday, September 6, 2019

NOTEPAD ++ INFO

Removing duplicate rows in Notepad++

You will need the TextFX plugin. This used to be included in older versions of Notepad++, but if you have a newer version, you can add it from the menu by going to Plugins -> Plugin Manager -> Show Plugin Manager -> Available tab -> TextFX -> Install. In some cases it may also be called TextFX Characters, but this is the same thing
The check boxes and buttons required will now appear in the menu under: TextFX -> TextFX Tools.
Make sure "sort outputs only unique..." is checked. Next, select a block of text (Ctrl+A to select the entire document). Finally, click "sort lines case sensitive" or "sort lines case insensitive"
menu layout in n++

Since Notepad++ Version 6 you can use this regex in the search and replace dialogue:
^(.*?)$\s+?^(?=.*^\1$)
and replace with nothing. This leaves from all duplicate rows the last occurrence in the file.
No sorting is needed for that and the duplicate rows can be anywhere in the file!
You need to check the options "Regular expression" and ". matches newline":
Notepad++ Replace dialogue
  • ^ matches the start of the line.
  • (.*?) matches any characters 0 or more times, but as few as possible (It matches exactly on row, this is needed because of the ". matches newline" option). The matched row is stored, because of the brackets around and accessible using \1
  • $ matches the end of the line.
  • \s+?^ this part matches all whitespace characters (newlines!) till the start of the next row ==> This removes the newlines after the matchd row, so that no empty row is there after the replacement.
  • (?=.*^\1$) this is a positive lookahead assertion. This is the important part in this regex, a row is only matched (and removed), when there is exactly the same row following somewhere else in the file.
OR

if the rows are immediately after each other then you can use a regex replace
Search Pattern: ^(.*\r?\n)(\1)+
Replace with: \1
OR
Notepad++
-> Replace window
Ensure that in Search Mode
you have selected Regular expression radio button
Find what:
^(.*)(\r?\n\1)+$
Replace with:
$1
before:
and we think there
and we think there
single line
Is it possible to
Is it possible to
after:
and we think there
single line
Is it possible to

Delete all lines in Notepad++ except lines containing a word

There is an easy way to achieve this. You need to perform 3 steps.
  1. Go to Search menu > Find... > Select "Mark" Tab. Activate regular expressions. Search for ^<Path> (^ is for line start). Don't forget to check "Bookmark lines" and Press "Mark All"
    ==> All Rows you want to keep got a Bookmark
  2. Go to Menu "Search - Bookmark - Inverse Bookmark"
    ==> All Line you want to delete are bookmarked.
  3. Go to Menu "Search - Bookmark - Remove Bookmarked lines"
    ==> All Bookmarked lines are deleted.

How can I delete rest of the line after a specific string?

Before
 *://81.88.22.6/*=UUID:63969B2469B7A94EBBDBD7CB5B9C00BA
Search mode regular expression, Find
=UUID:.*
Replace with nothing.
OR
My answer:
[=].*




Add To Google BookmarksStumble ThisFav This With TechnoratiAdd To Del.icio.usDigg ThisAdd To RedditTwit ThisAdd To FacebookAdd To Yahoo

Sunday, September 1, 2019

Special IP Address Ranges and Their Meaning

Some IP addresses and IP ranges are reserved for special use, such as for local or private networks, and should not appear on the public internet. These reserved ranges, along with other IP ranges that haven't yet been allocated and therefore also shouldn't appear on the public internet are sometimes known as bogons.
Because bogon IP addresses don't belong to a specific user or server on the internet, so there's no way to geolocate them. Therefore our IP geolocation APIwon't return location information for IP addresses within bogon ranges, but it will return a bogon field to indicate that the IP address is a bogon.

IPv4 Bogon Ranges

NetblockDescription
0.0.0.0/8"This" network
10.0.0.0/8Private-use networks
100.64.0.0/10Carrier-grade NAT
127.0.0.0/8Loopback
127.0.53.53Name collision occurrence
169.254.0.0/16Link local
172.16.0.0/12Private-use networks
192.0.0.0/24IETF protocol assignments
192.0.2.0/24TEST-NET-1
192.168.0.0/16Private-use networks
198.18.0.0/15Network interconnect device benchmark testing
198.51.100.0/24TEST-NET-2
203.0.113.0/24TEST-NET-3
224.0.0.0/4Multicast
240.0.0.0/4Reserved for future use
255.255.255.255/32Limited broadcast

IPv6 Bogon Ranges

NetblockDescription
::/128Node-scope unicast unspecified address
::1/128Node-scope unicast loopback address
::ffff:0:0/96IPv4-mapped addresses
::/96IPv4-compatible addresses
100::/64Remotely triggered black hole addresses
2001:10::/28Overlay routable cryptographic hash identifiers (ORCHID)
2001:db8::/32Documentation prefix
fc00::/7Unique local addresses (ULA)
fe80::/10Link-local unicast
fec0::/10Site-local unicast (deprecated)
ff00::/8Multicast (Note: ff0e:/16 is global scope and may appear on the global internet.)

IPv6 Additional Bogon Ranges

These ranges aren't officially IPv6 bogon ranges - they're IPv6 representations of different IPv4 bogon ranges.
NetblockDescription
2002::/246to4 bogon (0.0.0.0/8)
2002:a00::/246to4 bogon (10.0.0.0/8)
2002:7f00::/246to4 bogon (127.0.0.0/8)
2002:a9fe::/326to4 bogon (169.254.0.0/16)
2002:ac10::/286to4 bogon (172.16.0.0/12)
2002:c000::/406to4 bogon (192.0.0.0/24)
2002:c000:200::/406to4 bogon (192.0.2.0/24)
2002:c0a8::/326to4 bogon (192.168.0.0/16)
2002:c612::/316to4 bogon (198.18.0.0/15)
2002:c633:6400::/406to4 bogon (198.51.100.0/24)
2002:cb00:7100::/406to4 bogon (203.0.113.0/24)
2002:e000::/206to4 bogon (224.0.0.0/4)
2002:f000::/206to4 bogon (240.0.0.0/4)
2002:ffff:ffff::/486to4 bogon (255.255.255.255/32)
2001::/40Teredo bogon (0.0.0.0/8)
2001:0:a00::/40Teredo bogon (10.0.0.0/8)
2001:0:7f00::/40Teredo bogon (127.0.0.0/8)
2001:0:a9fe::/48Teredo bogon (169.254.0.0/16)
2001:0:ac10::/44Teredo bogon (172.16.0.0/12)
2001:0:c000::/56Teredo bogon (192.0.0.0/24)
2001:0:c000:200::/56Teredo bogon (192.0.2.0/24)
2001:0:c0a8::/48Teredo bogon (192.168.0.0/16)
2001:0:c612::/47Teredo bogon (198.18.0.0/15)
2001:0:c633:6400::/56Teredo bogon (198.51.100.0/24)
2001:0:cb00:7100::/56Teredo bogon (203.0.113.0/24)
2001:0:e000::/36Teredo bogon (224.0.0.0/4)
2001:0:f000::/36Teredo bogon (240.0.0.0/4)
2001:0:ffff:ffff::/64Teredo bogon (255.255.255.255/32)

Add To Google BookmarksStumble ThisFav This With TechnoratiAdd To Del.icio.usDigg ThisAdd To RedditTwit ThisAdd To FacebookAdd To Yahoo