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

Thursday, August 15, 2019

Could not get lock /var/lib/dpkg/lock-frontend

This may happen if
  1. 'Synaptic Package Manager' or 'Software Updater' is open.
  2. Some apt command is running in Terminal.
  3. Some apt process is running in background.
For above wait for the process to complete. If this does not happen run in terminal:
sudo killall apt apt-get
If none of the above works, remove the lock files. Run in terminal:
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock*
then reconfigure the packages. Run in terminal:
sudo dpkg --configure -a
and
sudo apt update
That should do the job.

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

Wednesday, August 14, 2019

How To Update/Install Kernel Headers in Kali Linux


Step One:
First, we need to make sure that the official Kali Linux repositories are added to the “sources.list” file.
Open a Terminal and type leafpad /etc/apt/sources.list and press Enter.
2

Step Two:
In the file that opens, look over it. If it contains all the lines listed below, then you can close it and continue on to Step Three. However, if it is empty or contains text different than the text listed below, delete everything inside it and replace it with the below text:



deb http://http.kali.org/kali kali main non-free contrib

deb http://security.kali.org/kali-security kali/updates main contrib non-free

deb-src http://http.kali.org/kali kali main non-free contrib

deb-src http://security.kali.org/kali-security kali/updates main contrib non-free



If you have to manually type it, be sure to double check it, as even the slightest error will result in Kali Linux not updating properly.
Once you have finished, close leafpad and click Yes when it asks you if you want to save the changes.
1

Step Three:
Now, in the Terminal, type the below command:
apt-get update && apt-get install -y linux-headers-$(uname -r)
And press Enter.

Step Four:
It will ask you if you want to install the new updates (headers). Type Y for “yes” and press Enter again.

Step Five:

Once it has completely finished updating, and you’re presented with the root@kali prefix again, type reboot in the terminal to restart Kali Linux.

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

Kali Linux Update Problem Repository

Your /etc/sources.list should be:

deb http://http.kali.org/kali kali-rolling main contrib non-free
# For source package access, uncomment the following line
# deb-src http://http.kali.org/kali kali-rolling main contrib non-free

However if the above official source not working to you, you may use the official kali mirrors.
 
1) Go to this link http://http.kali.org/README.mirrorlist
2) under "mirrors which handle this country" copy any one of the link (example in my case: http://kali.cs.nctu.edu.tw/kali/README )
3) Open nano /etc/apt/sources.list and paste it at the bottom.
4) Remove "/README" from the link and make it looks like this -> "deb http://kali.cs.nctu.edu.tw/kali kali-rolling main contrib non-free"
5) Comment all previous sources except the mirror that you just pasted.
6) and finally your Mirror sources.list should be like this: (Example of my kali mirror sources.list)

#Kali Linux Rolling Official Repositories
#deb http://http.kali.org/kali kali-rolling main contrib non-free

#Kali Linux Rolling Official Mirrors Repositories
deb http://kali.cs.nctu.edu.tw/kali kali-rolling main contrib non-free

7) Exit and write changes.
8) Run apt-get clean && apt-get update and see if it works.
9) If it still doesn't working, try to replace it with another mirror.

Hope this helps anyone out there.

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