Cum se creeaza un cont de business pe Instagram

Care sunt avantajele unui cont profesional pe Instagram?

Odata cu folosirea unui cont pentru business, accesam mult mai multe instrumente puse la dispozitie de catre Instagram pentru a ajuta companiile sa se extinda si sa ajunga la cat mai multe persoane. Putem vedea statisticile contului despre urmaritori si despre performantele continutului (vizualizari, interactiuni etc), putem crea reclame si putem adauga in profil butoane de contact pentru a le fi mai usor utilizatorilor sa intre in contact cu compania/persoana publica.

[mai mult...]

How to Zip and Unzip Files With Gzip on Linux

There are many file compression utilities, but the one you’re guaranteed to find on every Linux distribution is gzip. If you only learn to use one compression tool, it should be gzip .

Algorithms and Trees

The gzip data compression tool was written in the early 1990s, and it’s still found in every Linux distribution. There are other compression tools available, but no matter which Linux computer you find yourself needing to work on, you’ll find gzip on it. So if you know how to use gzip, you’re good to go without the need to install anything.

gzip is an implementation of the DEFLATE algorithm which was invented—and patented—by Phil Katz of PKZIP fame. The DEFLATE algorithm improved on earlier compression algorithms which all operated on variations of a theme. The data to be compressed is scanned, and unique strings are identified and added to a binary tree.

The unique strings are allocated a unique ID token by virtue of their position in the tree. The tokens are used to replace the strings in the data and, because the tokens are smaller than the data they replaced, the file is compressed. Substituting the tokens for the original strings re-inflates the data back to its uncompressed state.

The DEFLATE algorithm added the twist that the most frequently encountered strings were allocated the smallest tokens and the least frequently encountered strings were allocated larger ones. The DEFLATE algorithm also incorporated ideas from two earlier compression methods, Huffman coding and LZ77 compression.

At the time of writing, the DEFLATE algorithm is nearly three decades old. Three decades ago data storage costs were high and transmission speeds were slow. Data compression was vitally important.

4 Ways to Free Up Disk Space on Linux

Data storage is much cheaper today, and transmission speeds are orders of magnitude faster. But we have so much more data to store, and the world over people are accessing cloud storage and streaming services. Data compression is still vitally important, even if all you’re doing is shrinking something that you need to upload or transmit, or you’re trying to claw back some space on a local hard drive.

The gzip Command

The bigger a file is, the better the compression can be. This is because of two reasons. One is there will be many repeated, identical sequences of bytes throughout a large file. The second reason is the list of strings and tokens needs to be stored in the compressed file so that decompression can take place. With a very small file that overhead can wipe out the benefits of the compression. But even with a fairly small file, there’s likely to be some reduction in size.

Compressing a File

To compress a file, all you need to do is pass the name of the file to the gzip command. We’ll check the original size of the file, compress it, and then check the size of the compressed file.

ls -lh calc-sheet.ods
gzip calc-sheet.ods
ls -lh cal-*

Compressing a spreadsheet

The original file, a spreadsheet called “calc-sheet.ods” is 11 KB,  and the compressed file—also known as an archive file—is 9.3 KB. Note that the name of the archive file is the name of the original file with “.gz” appended to it.

The first use of the ls command targets a specific file, the spreadsheet. The second use of ls looks for all files beginning with “calc-” but it only finds the compressed file. That’s because, by default, gzip creates the archive file and deletes the original file.

That’s not an issue. If you need the original file you can retrieve it from the archive file. But if you prefer to retain the original file, you can use the -k (keep) option.

gzip -k calc-sheet.ods
ls -lh calc-sheet.*

Compressing a file and retaining the original file

This time the original ODS file is retained.

Decompressing a File

To decompress a GZ archive file, use the -d (decompress) option. This will extract the compressed file from the archive and decompress it so that it is indistinguishable from the original file.

ls calc-sheet.*
gzip -d calc-sheet.ods.gz
ls calc-sheet.*

Decompressing a file with gzip

This time, we can see that gzip has deleted the archive file after extracting the original file. To retain the archive file, we need to use the -k (keep) option again, as well as the -d (decompress) option.

ls calc-sheet.*
gzip -d calc-sheet.ods.gz
ls calc-sheet.*

Decompressing a file and retaining the archive file

This time, gzip doesn’t delete the archive file.

Decompressing and Overwriting

If you try to extract a file in a directory where the original file—or a different file with the same—exists,  gzip  will prompt you to choose to abandon the extraction or to overwrite the existing file.

gzip -d text-file.txt.gz

Overwrite prompt from gzip when the file in the archive already file exists in the directory

If you know in advance that you’re happy to have the file in the directory overwritten by the file from the archive, use the -f (force) option.

gzip -df text-file.txt.gz

Forcing overwriting of an existing file

The file is overwritten and you’re silently returned to the command line.

Compressing Directory Trees

The -r (recursive) option causes gzip to compress the files in an entire directory tree. But the result might not be what you expect.

Here’s the directory tree we’re going to use in this example. The directories each contain a text file.

tree level1

Test directory tree structure

Let’s use gzip on the directory tree and see what happens.

gzip -r level1/
tree level1

Directory structure after running gzip on it

The result is gzip has created an archive file for each text file in the directory structure. It didn’t create an archive of the entire directory tree. In fact, gzip can only put a single file in an archive.

We can create an archive file that contains a directory tree and all of its files, but we need to bring another command into play. The tar program is used to create archives of many files, but it doesn’t have its own compression routines. But by using the appropriate options with tar, we can cause tar to push the archive file through gzip. That way we get a compressed archive file and a multi-file or multi-directory archive.

tar -czvf level1.tar.gz level1

The tar options are:

  • c: Create an archive.
  • z: Push the files through gzip.
  • v: Verbose mode. Print in the terminal window what tar is up to.
  • f level1.tar.gz: Filename to use for the archive file.

Output from tar working its way through the directory tree

This archives the directory tree structure and all files within the directory tree.

Getting Information About Archives

The -l (list) option provides some information about an archive file. It shows you the compressed and uncompressed sizes of the file in the archive, the compression ratio, and the name of the file.

gzip -l leve1.tar.gz
gzip -l text-file.txt.gz

Using the -l list option to see compression statistics for an archive

You can check the integrity of an archive file with the -t (test) option.

gzip -t level1.tar.gz

Testing an archive with the -t option

If all is well, you’re silently returned to the command line. No news is good news.

If the archive is corrupt or not an archive you’re told about it.

gzip -t not-an-archive.gz

Using the -t option to test a file that isn't an archive

Speed Versus Compression

You can choose to prioritize the speed of creation of the archive or the degree of compression. You do this by providing a number as an option, from -1 through top -9. The -1 option gives the fastest speed at the sacrifice of compression and -9 gives the highest compression at the sacrifice of speed.

Unless you provide one of these options, gzip uses -6.

gzip -1 calc-sheet.ods
ls -lh calc-sheet.ods.gz
gzip -9 calc-sheet.ods
ls -lh calc-sheet.ods.gz
gzip -6 calc-sheet.ods
ls -lh calc-sheet.ods.gz

Using gzip with different priorities for speed and compression

With a file as small as this, we didn’t see any significant difference in speed of execution, but there was a small difference in compression.

Interestingly, there is no difference between using level 9 compression and level 6 compression. You can only wring so much compression out of any given file and in this case, that limit was reached with level 6 compression. Cranking it up to 9 brought no further reduction in filesize. With bigger files, the difference between level 6 and level 9 would be more pronounced.

Compressed, Not Protected

Don’t mistake compression for encryption or any form of protection. Compressing a file doesn’t give it any security or enhanced privacy. Anyone with access to your file can use gzip to decompress it.

[mai mult...]

What Is Shadowsocks, and How Does It Work?

A wooden figure blocking connections.

If you’re looking to escape internet censorship, one interesting option is something called Shadowsocks. Not only is its name intriguing, it also promises to get you past any blocks safely. Let’s see what this protocol can and cannot do.

What Is Shadowsocks?

Shadowsocks is a connection tool that lets you circumvent censorship. It’s used widely in China by people looking to tunnel under the Great Firewall—the digital barrier that keeps the Chinese internet “safe” from foreign influence—as it’s completely free, though you’ll need some tech know-how to set it up.

In fact, Shadowsocks is so good at getting past China’s blocks that there’s a good case to be made for it over another tool, virtual private networks (VPNs). Not only is using Shadowsocks free, it also hides traffic a little better than VPNs do. However, before we go into any more detail, let’s first go over where Shadowsocks comes from.

Who Developed Shadowsocks?

Shadowsocks was developed by a Chinese programmer only known as “clowwindy,” who put the initial commit (a version of a program or script) on GitHub in 2012. The protocol was a huge success and clowwindy kept working on it for several years, as well as developing a free VPN called ShadowVPN.

In 2015, however, Clowwindy left a message on a GitHub thread stating that the police had found him and had asked him to stop working on Shadowsocks and, presumably, ShadowVPN. He also was forced to delete the code on GitHub and he had “no choice but to obey.” He added that “I hope one day I’ll live in a country where I have freedom to write any code I like without fearing.”

What Happened to Clowwindy?

After this last message, it has remained quiet surrounding clowwindy. According to this blog post, after clowwindy had an “invitation to tea” (a term with about the same level of threat as the KGB’s infamous “friendly chat”), they briefly surfaced to show they were okay, and then faded away.

Thankfully, though, clowwindy’s work has not been relegated to the dustbin of history. Instead, a team of enthusiasts has carried on their work and kept working on Shadowsocks. At the time of writing in March 2022, it’s a powerful piece of communication technology that has gotten even better at getting past blocks.

How Does Shadowsocks Work?

Shadowsocks is interesting because it’s like a lot of other things, but just different enough that it deserves its own category. Technically, it’s just a proxy: it reroutes an internet connection through a third server, making it appear like you’re in a different location.

In a regular network connection, like the one you’re likely using now, you connect to your internet service provider’s server and then to the website you want to visit. If the authorities want to block a site, the internet service provider (ISP) is usually told to prevent access to its IP address. Using a proxy means you go from the ISP to an unblocked server and then to the site you want.

However, regular proxies are notoriously unsafe: there’s no good way to secure the connection, for one, and generally speaking, most sites can figure out quite easily that you’re using one. Shadowsocks, however, is based on a proxy protocol called SOCKS5 that secures the connection using an AEAD cipher—roughly along the same lines as an SSH tunnel.

Though AEAD ciphers are generally considered not quite as secure as the more common AES encryption (here’s one academic paper if you’d like to know more), they’re a big step up from regular proxies. They generally either use an HTTP-based protocol—pretty much just a rerouted unsecured connection—or an earlier SOCKS version which also isn’t encrypted. Using either one means you’re leaving yourself open to possible spying by, well, almost anybody.

Shadowsocks and VPNs

Reading the above, you may think that Shadowsocks sounds an awful lot like virtual private networks, which also reroute connections, but secure them as well. However, because Shadowsocks’ encryption is a little more lightweight, it doesn’t offer the same security as a VPN does.

However, the lighter encryption does mean that Shadowsocks can fly under the radar better than a VPN can. If they wanted to, an ISP could clearly identify VPN traffic, but a Shadowsocks connection is a lot harder to identify because it looks practically identical to a regular HTTPS connection.

Downsides to Shadowsocks

Because of these reasons, Shadowsocks is a great choice to dodge censorship blocks. However, it’s not perfect and there are some downsides, especially if compared to VPNs or even Tor.

For one, Shadowsocks requires a bit of setup and you need to understand a little how computers and connections work. VPNs generally just need to be installed and you’re good to go; using Shadowsocks means you need to sit down and read through the documentation and set up a server.

Depending on how you set it up, there’s a chance that Shadowsocks might take a good whack out of your internet speed. Any rerouting technology will reduce your speed, but some are worse than others. A good server will reduce the pain, but generally speaking, using Shadowsocks means a much slower connection. Also, unlike VPNs, you can’t use Shadowsocks to change your Netflix region or even to torrent files.

However, you could also argue that none of that matters: Shadowsocks was developed as a way to circumvent the blocks placed on free speech by a despotic regime and to do so for free. At that, it succeeds admirably and we recommend anybody looking to escape internet censorship at least look into it.

[mai mult...]