UNDERCODE COMMUNITY
2.69K subscribers
1.23K photos
31 videos
2.65K files
80.5K links
πŸ¦‘ Undercode Cyber World!
@UndercodeCommunity


1️⃣ World first platform which Collect & Analyzes every New hacking method.
+ AI Pratice
@Undercode_Testing

2️⃣ Cyber & Tech NEWS:
@Undercode_News

3️⃣ CVE @Daily_CVE

✨ Web & Services:
β†’ Undercode.help
Download Telegram
Forwarded from UNDERCODE NEWS
2021 digital cockpit releases from Samsung incorporate many high-tech cockpits.
#Technologies
Forwarded from UNDERCODE NEWS
Apple canceled accessories and became a lucrative business, gaining more than 1.7 billion a year.
#Analytiques
▁ β–‚ β–„ Uπ•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁

πŸ¦‘Basic bash β€” Bash if statements: if, elif, else, then, fi
We also have a special elif, which we will learn more about later.

Let's start with a simple example.

In this guide, you will learn:

How to implement an if statement on the Bash command line
How such if statements can also be used inside Bash scripts
Examples showing if, elif, else, then and fi work in Bash
Example 1: a simple if statement on the command line
$ if [ 1 -eq 1 ]; then echo "Matched!"; fi
Matched!
In this example, we are comparing one to one.

Note that -eq means equal.

To do the opposite, you can use -ne, which means not equal, as shown in the following example:

$ if [ 0 -ne 1 ]; then echo "Matched!"; fi
Matched!
In this case, we checked for inequality, and since 0 is not equal to 1, the if statement is correct and the commands after then will be executed.
Let's change this a bit:
$ if [ 1 -ne 1 ]; then echo "Matched!"; else echo "Not Matched!"; fi
Not Matched!
Here we have introduced the else statement; what commands to execute if the condition in the if statement turns out to be false (or incorrect).

When we try to ask if 1 (-ne) is 1 this time, and since 1 is indeed 1, the condition formulated in this if statement is false, and we encounter our else statement with the matching text printed out.

Example 2: Using an if statement in a Bash shell script
It's worth noting that you can easily copy and paste any if statement shown here or elsewhere and use it inside a Bash shell script.

For example:

$ echo '#!/bin/bash' > myscript.sh
$ echo 'if [ 1 -eq 1 ]; then echo "Matched!"; fi' >> myscript.sh
$ chmod +x myscript.sh
$ ./myscript.sh
Matched!
$
Here we just created a small shell script myscript.sh using echo and the redirector> to redirect the output from our echo to a file.

When you use> a new file will be created and any file with the same name will be overwritten, so use with caution.

We then add our if statement again using echo and the double redirector >>, which, unlike>, does not create a new file, but simply adds text to the specified file.

Then we chmod + x to the script to make it executable, and execute the script with the ./ prefix, which is required in bash (any valid pathname will do).

The first line of the script just makes sure that we will be using the bash interpreter for our script.

It is recommended to always install it in bash and other scripts (for other scripts, you can install any interpreter that will execute your script, for example #! / Usr / bin / python3 for Python 3 (.py3 for example), etc.).

When we execute the script, we see that the result is generated as expected (1 equals 1).

Matched!
Example 3: What is elif?
The elif operator provides additional abbreviation flexibility by minimizing the need for nested operators.

Consider the following script test.sh:

#!/bin/bash
if [ 0 -eq 1 ]; then
echo '0=1'
else
if [ 0 -eq 2 ]; then
echo '0=2'
else
echo '0!=2'
fi
fi
And the output from it:

$ ./test.sh
0!=2

▁ β–‚ β–„ Uπ•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁
Forwarded from UNDERCODE TESTING
German Chancellor Merkel: The decision by Twitter to block the Trump account is "Not right"
#International

MORE DETAILS - https://undercodenews.com/german-chancellor-merkel-the-decision-by-twitter-to-block-the-trump-account-is-not-right/11/01/2021/
Forwarded from UNDERCODE TESTING
Starting at $499, Dynabook launches Satellite Pro laptops.
#Technologies

MORE DETAILS - https://undercodenews.com/starting-at-499-dynabook-launches-satellite-pro-laptops/11/01/2021/
▁ β–‚ β–„ Uπ•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁

πŸ¦‘ How to enable rc.local shell script in systemd on Linux boot ?

Enabling rc.local shell script in systemd at boot of Linux system
Compatibility with /etc/rc.local is achieved through systemd using a special service called rc-local.service.

This module is automatically called in multi-user.target by systemd-rc-local-generator if /etc/rc.local is executable.

Executing rc.local shell script at boot time using systemd
Naturally, create or update / edit a file called /etc/rc.local using your favorite text editor.

I'm going to use the vim command:

$ sudo vim /etc/rc.local
$ sudo vim /etc/rc.d/rc.local

Add the required commands or call the script.
Here is my file:
#!/bin/sh
# add your commands
# call your scripts here

# let us set stuff for my wifi
/sbin/iw phy0 wowlan enable magic-packet disconnect

# last line must be exit 0
exit 0
Save and close the file when using vim.

🐧 How to save a file in Vi / Vim and exit

Make sure you set the executable permissions for the file with the chmod command:

$ sudo chmod -v +x /etc/rc.local

Setting up rc-local.service on Linux when systemd starts
All we need to do is enter the following systemctl command:

$ sudo systemctl enable rc-local.service

Reboot Linux:
$ sudo reboot
Check the status after reboot:
$ sudo systemctl status rc-local.service
Here's what we see on the screen:
● rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/etc/systemd/system/rc-local.service; enabled-runtime; ven>
Drop-In: /usr/lib/systemd/system/rc-local.service.d
└─debian.conf
Docs: man:systemd-rc-local-generator(8)
Tasks: 0 (limit: 37939)
Memory: 0B
CGroup: /system.slice/rc-local.serviceHow to view service configuration
Open the terminal app and type:

$ sudo systemctl cat rc-local.service

We will see the systemd configuration as follows:
# /etc/systemd/system/rc-local.service
# SPDX-License-Identifier: LGPL-2.1+
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.

# This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.local is executable.
[Unit]
Description=/etc/rc.local Compatibility
Documentation=man:systemd-rc-local-generator(8)
ConditionFileIsExecutable=/etc/rc.local
After=network.target

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no

# /usr/lib/systemd/system/rc-local.service.d/debian.conf
[Unit]
# not specified by LSB, but has been behaving that way in Debian under SysV
# init and upstart
After=network-online.target

# Often contains status messages which users expect to see on the console
# during boot
[Service]
StandardOutput=journal+console
StandardError=journal+console
@Undercoder
▁ β–‚ β–„ Uπ•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁
Forwarded from UNDERCODE NEWS
The first batch of Wi-Fi 6E router devices was introduced by TP-Link.
#Technologies
Forwarded from UNDERCODE NEWS
Amazon buys a fleet of airlines to autonomously deliver.
#International
▁ β–‚ β–„ Uπ•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁

πŸ¦‘ 2021 FREE & LEGIT :

Day 1 - A Christmas Crisis
Day 2 - The Elf Strikes Back
Day 3 - Christmas Chaos
Day 4 - Santa's watching
Day 5 - Someone stole Santa's gift list!
Day 6 - Be careful with what you wish on a Christmas night
Day 7 - The Grinch Really Did Steal Christmas
Day 8 - What's Under the Christmas Tree?
Day 9 - Anyone can be Santa!
Day 10 - Don't be Elfish!
Day 11 - The Rogue Gnome
Day 12 - Ready, set, elf.
Day 13 - Coal for Christmas
Day 14 - Where's Rudolph?
Day 15 - There's a Python in my stocking!
Day 16 - Help! Where is Santa?
Day 17 - ReverseELFneering
Day 18 - The Bits of the Christmas
Day 19 - The Naughty or Nice List
Day 20 - PowershELlF to the rescue
Day 21 - Time for some ELForensics
Day 22 - Elf McEager becomes CyberElf
Day 23 - The Grinch strikes again!
Day 24 - The Trial Before Christmas

https://github.com/flyme2bluemoon/thm-advent

▁ β–‚ β–„ Uπ•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁
Forwarded from UNDERCODE NEWS
Due to a harmful flaw, LG is planning a major recall of its smart TVs in Russia.
#International
Forwarded from UNDERCODE NEWS
The designer of "Gosoblak" acquired by VTB is searching for 2.5 billion Intel servers.
#International
▁ β–‚ β–„ Uπ•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁

πŸ¦‘πŸ” How to add and remove GPG key on Ubuntu:

A) )What is a GPG key?
The G) is free software that provides cryptographic protecGPG key (which stands for Gnu Privacy Guard, aka GnuPtion of sensitive data and authentication.

It allows users to communicate securely using public key cryptography.

B ) ) How does a GPG key work in a repository?
All packages are signed with an accompanying private / public key pair.

The user's private key is kept secret and the public key can be shared with anyone the user wants to communicate with.

Each time you add a new repository to your system, you must also add the repository key so that the APT Package Manager trusts the newly added repository.

Once you've added the repository keys, you can ensure that you get the packages from a trusted source.

C ) ) How do I list the keys of a repository?
apt-key is used to manage the list of keys used by apt to authenticate packages.

Trusted keys are stored in the following locations:

/etc/apt/trusted.gpg - a bunch of local trusted keys, new keys will be added here.
/etc/apt/trusted.gpg.d/ - File fragments for trusted keys, additional keychains can be stored in this location.
Use the following command to list the trusted keys with figprints:

$ sudo apt-key list


/etc/apt/trusted.gpg

D ) ) How do I delete repository keys?
You can delete the repository key if it is no longer needed or the repository has already been removed from the system.

It can be removed by entering the fully quoted key as shown below (which has a hexadecimal value of 40 characters).

$ sudo apt-key del "D320 D0C3 0B02 E64C 5B2B B274 3766 2239 8999 3A70"
OK
Alternatively, you can remove the key by entering only the last 8 characters.

$ sudo apt-key del 89993A70
OK
After removing the repository key, run the apt command to update the repository index.

$ sudo apt update
You can verify that the above GPG key has been removed by running the following command.

$ sudo apt-key list

▁ β–‚ β–„ Uπ•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁
HACK/CVE/NEWS... AND MORE