Linux
Encrypt and Decrypt files with GPG in linux
Today, I would like to share about encrypting and decrypting files with GPG in linux. Let’s take a look.
GPG, known as GNU Privacy Guard (GnuPG), is an open-source command-line tool to encrypt things like files, emails, messages and so on.
Installation
GPG usually pre-installed with most of the Linux Distributions. But just in case, you can install by the following command in terminal.
sudo apt install gnupg
Usage
Generate keys
To encrypt files, you need to generate a GPG key on the system firstly.
gpg –full-generate-key
If the options to select are asked, you can read and use default values by pressing Enter.
But you will need to fill name and email.

Checking GPG keys
You can also check your key lists as follows.

Encrypting a file
Firstly, let’s create a sample text file with some text.

And let’s encrypt a file by the following command.

The recipient argument is the email you wrote when creating key.
The above command output the encrypted file with .gpg extension. You can delete original file after encryption.

And we can see the contents of the encrypted file as follow.

Decrypting a file
You can decrypt an encrypted gpg file by the following command.

This command outputs a decrypted file named decrypted_test.txt. Now you can see correct text contents of the file.
So this is all for now and for more details, I recommend to read here.
Hope you enjoy that.
By Asahi
waithaw at 2022年05月10日 10:00:00
- 2022年04月29日
- 技術情報
知っておいていただきたいこと – 3
今回も、Laravelの知っておいた方がいいとおもったことをいくつか紹介します。
Tip # Laravel #exclude
入力を受け付けると、そのデータを使ってモデルを作りたいと思うことがよくあります。
例えば、登録フォームはUserモデルを作成するために使われるでしょう。しかし、すべてのフィールドを検証する必要がある一方で、モデルを作成するためにすべてのフィールドを必要としないかもしれません。このような場合、「exclude」ルールを使用します。
class StoreRequest extends FormRequest
{
public function rules(){
return [
'name' => 'required|string',
'email_address' => 'required|string|email',
'terms_and_conditions' => 'required|accepted|exclude',
];
}
}
exclude’ ルールを使用すると、Laravel は ‘terms_and_conditions’ フィールドが全てのバリデーションルールをパスすることを保証しますが、 ‘validate’ または ‘validated’ メソッドによって返されるわけではありません。これにより、DBに’terms_and_conditions’のカラムがないことを気にせずに、簡単にモデルを作ることができます。
class RegistrationController extends Controller
{
public function store(StoreRequest $request)
{
$playload = $request->validate(); //名とメールだけ
$user = User::create($playload);
Auth::login($user);
return redirect()->route('dashboard');
}
}
ということで、今回はこれで終わります。
金曜担当 – Ami
asahi at 2022年04月29日 10:00:00
- 2022年04月26日
- 技術情報
A simple script to send email by SMTP in Python
Today, I would like to share about sending emails by SMTP with a simple python script. Let’s take a look.
To send smpt emails, we will need just one library smtplib that is a built-in python lib. Here is the code.

There are just simple 6 steps.
1. Connect to a SMTP server [line 3]
2. Sending the SMTP ‘Hello’ Message [line 4]
3. Starting TLS Encryption [line 5]
4. Logging in to the SMTP server [line 7]
5. Sending an Email [line 8]
6. Disconnecting from the SMTP server [line 11]
Note: To send with gmail SMTP, you will need to turn on ‘Less secure app access’ in your gmail account settings.
This is all for now. Hope you enjoy and can expand to further uses based on that.
By Asahi
waithaw at 2022年04月26日 10:00:00
- 2022年04月25日
- 技術情報
Low-Code Development Technology
Low code is a software development approach that requires little or no coding to create applications and softwares.
Instead of using a complex programming language, you can use a visual interface with basic logic and drag-and-drop capabilities on your low-code development platform.
Users with no advanced coding or software writing skills can use these intuitive techniques to create software for a variety of purposes, including mobile and business application creation.
These platforms are gaining popularity as a quick and easy alternative to traditional software development. The low-code framework can be used by engineers and “citizen developers” (non-professional developers) to build applications.
Low-code development
Instead of traditional hand-coded computer programming, the low-code development framework provides a programming environment for building software applications through a graphical user interface and configuration.
The low-code authoring framework allows users to embed building blocks in workflows and applications. These building blocks abstract the code behind actions and commands, allowing to build business interfaces and applications without having to manually code them.
Drag and drop functionality is available on popular lowcode platforms. This is one of the most important and valuable features that facilitates the manufacturing process. The drag-and-drop convenience provided during app development supports both civil and technical developers.
Security
Insecure low-code tools, no matter how convenient and easy to use, are not a good solution. Before you start using the low-code development framework, make sure you have enough protection to protect the app you are building and the entire platform.
There are still many factors to talk about but let me wrap up here for today. I will talk a bit more in future.
Yuuma
yuuma at 2022年04月25日 10:00:00
- 2022年04月21日
- 技術情報
DataTablesを使用したテーブル生成とサーバーサイド連携(9)
nishida at 2022年04月21日 10:00:00