Get catalog folder in Oracle
SELECT * FROM V$DIAG_INFO
Get catalog folder in Oracle
SELECT * FROM V$DIAG_INFO
Interpolated string in C# that string that contains before it symbol $.
That interpolated string can contain special expressions inside in curly braces:
int x = 18;
Console.Write($"Указанный возраст {x} лет."); // Выводит: Указанный возраст 18 лет.
Inside the curly braces can be placed any acceptable expressions C# of any type. C# do transform some value to string, using ToString() method or equivalent for chosen type.
Output format can be changed by add colon and then string format expression, for example:
string s = $"223 in HEX format: {223:X2}"; // X2 - Two digit HEX formatted number.
// Result "223 in HEX format: DF"
Example of converting XML into DYNAMIC and use it.
For begin we need some libraries:
using System;
using System.ComponentModel;
using System.Xml.Linq;
using Newtonsoft.Json;
Code:
string str = "<response><setter><name>Kiril</name></setter></response>";
XDocument doc = XDocument.Parse(str);
string jsn = JsonConvert.SerializeXNode(doc);
dynamic res = JsonConvert.DeserializeObject(jsn);
Console.WriteLine(res.response.setter.name);
That code convert string to XML, then XML to JSON and then convert it to dynamic object.
After that, from dynamic object it get Name property and send it ti console.
Exemple config for FTP (vsftpd) with lock user in home folder.
Install FTP in Ubuntu:
sudo apt install vsftpd
That's easy.
Next open config file
/etc/vsftpd.conf
Check that parameters in file be like that:
listen=NO
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
ftpd_banner=Welcome to My FTP service.
allow_writeable_chroot=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO
Example of creation the SEQUENCE in MSSQL:
CREATE SEQUENCE [dbo].[CardNum]
AS [bigint]
START WITH 1
INCREMENT BY 1
MINVALUE -9223372036854775808
MAXVALUE 9223372036854775807
CACHE
GO
That script will create the sequence named CardNum that have type BIGINT and begin from value 1 in current database.
Little wisdom:
For turning on xp_cmdshell just do:
-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1
GO
-- To update the currently configured value for this feature.
RECONFIGURE
GO
Restart MSSQL Server on Linux (Ubuntu).
Microsoft is recommend do that like this:
-- Get service state
sudo systemctl status mssql-server
-- Stop service
sudo systemctl stop mssql-server
-- Start service
sudo systemctl start mssql-server
-- Restart service
sudo systemctl restart mssql-server
To get current SESSION ID:
select @@spid
To get current TRANSACTION ID:
select CURRENT_TRANSACTION_ID()