Linux, UNIX command line examples, tutorials, and sample documentation. Learn how to use programs like mysql, ssh, tar, rsync, dd by example

copy
0
0
* Uncomment next line for versions <= 3.1 */ /* DROP INDEX rec_name_index ON records; */ ALTER TABLE records ADD disabled TI/* Uncomment next line for versions <= 3.3 */ /* ALTER TABLE domains ADD CONSTRAINT c_lowercase_name CHECK (((name)::TEXT = LOWER((name)::TEXT))); */ ALTER TABLE records ADD disabled BOOL DEFAULT 'f'; ALTER TABLE records ALTER COLUMN content TYPE VARCHAR(65535); ALTER TABLE records ADD ordername VARCHAR(255); ALTER TABLE records ADD auth BOOL DEFAULT 't'; ALTER TABLE records ALTER COLUMN type TYPE VARCHAR(10); ALTER TABLE supermasters ALTER COLUMN ip TYPE INET USING ip::INET; ALTER TABLE supermasters ALTER COLUMN account SET DEFAULT NOT NULL; ALTER TABLE supermasters ADD CONSTRAINT supermasters_pkey PRIMARY KEY (ip, nameserver); CREATE INDEX recordorder ON records (domain_id, ordername text_pattern_ops); CREATE TABLE domainmetadata ( id SERIAL PRIMARY KEY, domain_id INT REFERENCES domains(id) ON DELETE CASCADE, kind VARCHAR(32), content TEXT ); CREATE INDEX domainidmetaindex ON domainmetadata(domain_id); CREATE TABLE cryptokeys ( id SERIAL PRIMARY KEY, domain_id INT REFERENCES domains(id) ON DELETE CASCADE, flags INT NOT NULL, active BOOL, content TEXT ); CREATE INDEX domainidindex ON cryptokeys(domain_id); CREATE TABLE tsigkeys ( id SERIAL PRIMARY KEY, name VARCHAR(255), algorithm VARCHAR(50), secret VARCHAR(255), constraint c_lowercase_name CHECK (((name)::TEXT = LOWER((name)::TEXT))) ); CREATE UNIQUE INDEX namealgoindex ON tsigkeys(name, algorithm); CREATE TABLE comments ( id SERIAL PRIMARY KEY, domain_id INT NOT NULL, name VARCHAR(255) NOT NULL, type VARCHAR(10) NOT NULL, modified_at INT NOT NULL, account VARCHAR(40) DEFAULT NULL, comment VARCHAR(65535) NOT NULL, CONSTRAINT domain_exists FOREIGN KEY(domain_id) REFERENCES domains(id) ON DELETE CASCADE, CONSTRAINT c_lowercase_name CHECK (((name)::TEXT = LOWER((name)::TEXT))) ); CREATE INDEX comments_domain_id_idx ON comments (domain_id); CREATE INDEX comments_name_type_idx ON comments (name, type); CREATE INDEX comments_order_idx ON comments (domain_id, modified_at); For gpgsql backend with dnssec schema: /* Uncomment next 2 lines for versions <= 3.3 */ /* ALTER TABLE domains ADD CONSTRAINT c_lowercase_name CHECK (((name)::TEXT = LOWER((name)::TEXT))); */ /* ALTER TABLE tsigkeys ADD CONSTRAINT c_lowercase_name CHECK (((name)::TEXT = LOWER((name)::TEXT))); */ ALTER TABLE records ADD disabled BOOL DEFAULT 'f'; ALTER TABLE records ALTER COLUMN content TYPE VARCHAR(65535); ALTER TABLE records ALTER COLUMN auth SET DEFAULT 't'; ALTER TABLE records ALTER COLUMN type TYPE VARCHAR(10); ALTER TABLE supermasters ALTER COLUMN ip TYPE INET USING ip::INET; ALTER TABLE supermasters ALTER COLUMN account SET DEFAULT NOT NULL; ALTER TABLE supermasters ADD CONSTRAINT supermasters_pkey PRIMARY KEY (ip, nameserver); ALTER TABLE domainmetadata ALTER COLUMN kind TYPE VARCHAR(32); ALTER TABLE tsigkeys ALTER COLUMN algorithm TYPE VARCHAR(50); CREATE INDEX recordorder ON records (domain_id, ordername text_pattern_ops); DROP INDEX IF EXISTS orderindex; CREATE TABLE comments ( id SERIAL PRIMARY KEY, domain_id INT NOT NULL, name VARCHAR(255) NOT NULL, type VARCHAR(10) NOT NULL, modified_at INT NOT NULL, account VARCHAR(40) DEFAULT NULL, comment VARCHAR(65535) NOT NULL, CONSTRAINT domain_exists FOREIGN KEY(domain_id) REFERENCES domains(id) ON DELETE CASCADE, CONSTRAINT c_lowercase_name CHECK (((name)::TEXT = LOWER((name)::TEXT))) ); CREATE INDEX comments_domain_id_idx ON comments (domain_id); CREATE INDEX comments_name_type_idx ON comments (name, type); CREATE INDEX comments_order_idx ON comments (domain_id, modified_at); For gsqlite3 backend with nodnssec schema: ALTER TABLE records ADD disabled BOOL DEFAULT 0; ALTER TABLE records ADD ordername VARCHAR(255); ALTER TABLE records ADD auth BOOL DEFAULT 1; CREATE INDEX orderindex ON records(ordername); CREATE TABLE domainmetadata ( id INTEGER PRIMARY KEY, domain_id INT NOT NULL, kind VARCHAR(32) COLLATE NOCASE, content TEXT ); CREATE INDEX domainmetaidindex on domainmetadata(domain_id); CREATE TABLE cryptokeys ( id INTEGER PRIMARY KEY, domain_id INT NOT NULL, flags INT NOT NULL, active BOOL, content TEXT ); CREATE INDEX domainidindex ON cryptokeys(domain_id); CREATE TABLE tsigkeys ( id INTEGER PRIMARY KEY, name VARCHAR(255) COLLATE NOCASE, algorithm VARCHAR(50) COLLATE NOCASE, secret VARCHAR(255) ); CREATE UNIQUE INDEX namealgoindex ON tsigkeys(name, algorithm); CREATE TABLE comments ( id INTEGER PRIMARY KEY, domain_id INTEGER NOT NULL, name VARCHAR(255) NOT NULL, type VARCHAR(10) NOT NULL, modified_at INT NOT NULL, account VARCHAR(40) DEFAULT NULL, comment VARCHAR(65535) NOT NULL ); CREATE INDEX comments_domain_id_index ON comments (domain_id); CREATE INDEX comments_nametype_index ON comments (name, type); CREATE INDEX comments_order_idx ON comments (domain_id, modified_at); BEGIN TRANSACTION; CREATE TEMPORARY TABLE supermasters_backup ( ip VARCHAR(64) NOT NULL, nameserver VARCHAR(255) NOT NULL COLLATE NOCASE, account VARCHAR(40) DEFAULT NULL ); INSERT INTO supermasters_backup SELECT ip, nameserver, account FROM supermasters; UPDATE supermasters_backup SET account='' WHERE account IS NULL; DROP TABLE supermasters; CREATE TABLE supermasters ( ip VARCHAR(64) NOT NULL, nameserver VARCHAR(255) NOT NULL COLLATE NOCASE, account VARCHAR(40) NOT NULL ); CREATE UNIQUE INDEX ip_nameserver_pk ON supermasters(ip, nameserver); INSERT INTO supermasters SELECT ip, nameserver, account FROM supermasters_backup; DROP TABLE supermasters_backup; COMMIT; For gsqlite3 backend with dnssec schema: CREATE TABLE comments ( id INTEGER PRIMARY KEY, domain_id INTEGER NOT NULL, name VARCHAR(255) NOT NULL, type VARCHAR(10) NOT NULL, modified_at INT NOT NULL, account VARCHAR(40) DEFAULT NULL, comment VARCHAR(65535) NOT NULL ); CREATE INDEX comments_domain_id_index ON comments (domain_id); CREATE INDEX comments_nametype_index ON comments (name, type); CREATE INDEX comments_order_idx ON comments (domain_id, modified_at); BEGIN TRANSACTION; CREATE TEMPORARY TABLE records_backup( id INTEGER PRIMARY KEY, domain_id INTEGER DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, type VARCHAR(10) DEFAULT NULL, content VARCHAR(65535) DEFAULT NULL, ttl INTEGER DEFAULT NULL, prio INTEGER DEFAULT NULL, change_date INTEGER DEFAULT NULL, ordername VARCHAR(255), auth BOOL DEFAULT 1 ); INSERT INTO records_backup SELECT id,domain_id,name,type,content,ttl,prio,change_date,ordername,auth FROM records; DROP TABLE records; CREATE TABLE records ( id INTEGER PRIMARY KEY, domain_id INTEGER DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, type VARCHAR(10) DEFAULT NULL, content VARCHAR(65535) DEFAULT NULL, ttl INTEGER DEFAULT NULL, prio INTEGER DEFAULT NULL, change_date INTEGER DEFAULT NULL, disabled BOOLEAN DEFAULT 0, ordername VARCHAR(255), auth BOOL DEFAULT 1 ); CREATE INDEX rec_name_index ON records(name); CREATE INDEX nametype_index ON records(name,type); CREATE INDEX domain_id ON records(domain_id); CREATE INDEX orderindex ON records(ordername); INSERT INTO records SELECT id,domain_id,name,type,content,ttl,prio,change_date,0,ordername,auth FROM records_backup; DROP TABLE records_backup; COMMIT; BEGIN TRANSACTION; CREATE TEMPORARY TABLE supermasters_backup ( ip VARCHAR(64) NOT NULL, nameserver VARCHAR(255) NOT NULL COLLATE NOCASE, account VARCHAR(40) DEFAULT NULL ); INSERT INTO supermasters_backup SELECT ip,nameserver,account FROM supermasters; UPDATE supermasters_backup SET account='' WHERE account IS NULL; DROP TABLE supermasters; CREATE TABLE supermasters ( ip VARCHAR(64) NOT NULL, nameserver VARCHAR(255) NOT NULL COLLATE NOCASE, account VARCHAR(40) NOT NULL ); CREATE UNIQUE INDEX ip_nameserver_pk ON supermasters(ip, nameserver); INSERT INTO supermasters SELECT ip,nameserver,account FROM supermasters_backup; DROP TABLE supermasters_backup; COMMIT; BEGIN TRANSACTION; CREATE TABLE domainmetadata_backup ( id INTEGER PRIMARY KEY, domain_id INT NOT NULL, kind VARCHAR(32) COLLATE NOCASE, content TEXT ); INSERT INTO domainmetadata_backup SELECT id,domain_id,kind,content FROM domainmetadata; DROP TABLE domainmetadata; CREATE TABLE domainmetadata ( id INTEGER PRIMARY KEY, domain_id INT NOT NULL, kind VARCHAR(32) COLLATE NOCASE, content TEXT ); CREATE INDEX domainmetaidindex ON domainmetadata(domain_id); INSERT INTO domainmetadata SELECT id,domain_id,kind,content FROM domainmetadata_backup; DROP TABLE domainmetadata_backup; COMMIT; For goracle backend: ALTER TABLE records ADD disabled INT DEFAULT 0; ALTER TABLE records MODIFY auth INT DEFAULT 1; UPDATE records SET auth=1 WHERE auth IS NULL; ALTER TABLE domainmetadata MODIFY kind VARCHAR2(32); The Fox and the Stork At one time the Fox and the Stork were on visiting terms and seemed very good friends. So the Fox invited the Stork to dinner, and for a joke put nothing before her but some soup in a very shallow dish. This the Fox could easily lap up, but the Stork could only wet the end of her long bill in it, and left the meal as hungry as when she began. "I am sorry," said the Fox, "the soup is not to your liking." "Pray do not apologise," said the Stork. "I hope you will return this visit, and come and dine with me soon." So a day was appointed when the Fox should visit the Stork; but when they were seated at table all that was for their dinner was contained in a very long-necked jar with a narrow mouth, in which the Fox could not insert his snout, so all he could manage to do was to lick the outside of the jar. "I will not apologise for the dinner," said the Stork: "One bad turn deserves another."

2 weeks ago younes.haji.735 0 |

copy
0
0
rsa genNone

1 month ago princeofdream 0 |

copy
12
2
Log output and input of serial port using slsniffslsnif -u -s 115200 -l ./capture.log -i ./capture.bin "/dev/ttyUSB0"

1 year, 2 months ago JoshSanderson 5 |

copy
6
2
Create and link two virtual serial ports with socatsocat -d -d pty,raw,echo=0,link=/dev/ttyVCP-A pty,raw,echo=0,link=/dev/ttyVCP-B

1 year, 2 months ago JoshSanderson 5 |

copy
2
1
mv command without having to repeat entire pathmv /folder1/etc/etc/{file1.txt,file2.txt}

1 year, 2 months ago JoshSanderson 5 |

copy
1
0
anak dalitaNone

1 year, 5 months ago len 0 |

copy
8
0
xterm -bg red -fg blue topNone

1 year, 6 months ago mehdi gol 0 |

copy
4
0
xterm -bg red -fg white topNone

1 year, 6 months ago mehdi gol 0 |

copy
0
0
xterm -bg black -fg white topNone

1 year, 6 months ago mehdi gol 0 |

copy
1
0
tput resetNone

1 year, 6 months ago mehdi gol 0 |

copy
4
0
cal `date +"%m"` `date +"%Y"`None

1 year, 6 months ago mehdi gol 0 |

copy
15
copy
4
0
ssl_do_handshakei have problem on ssl_do_handshake working in intel machine but not in ARM based machine

1 year, 10 months ago pearl 0 |

copy
6
1
calculate and print size of binary logsdu -sm mysql-bin* | awk '{SUM +=$1} END {print SUM}'

1 year, 11 months ago ShahidMahmud 3 |

copy
0
0
byte count for queries which do NOT contain the 'UPDATE cache' linemysqlbinlog mysql-bin.000099 | grep -iv 'update cache' | wc -c

1 year, 11 months ago ShahidMahmud 3 |

copy
0
0
byte-count / size of update cache queries in binlogmysqlbinlog mysql-bin.000010 | grep -i 'update cache' | wc -cbyte-count for queries containing the words 'UPDATE cache'. Shows size of each binlog file dedicated to the 'UPDATE cache' queries.

1 year, 11 months ago ShahidMahmud 3 |

copy
0
1
queries have been logged to update the cache tables: mysqlbinlog mysql-bin.000099 | grep -ci 'update cache' find in mysql binary logs how many update queries were executed;

1 year, 11 months ago ShahidMahmud 3 |

copy
9
1
Data Base Size in MB from Information SchemaSELECT table_schema "Data Base Name", SUM( data_length + index_length) / 1024 / 1024 "Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema;Get Data Base Size in MB from Information Schema in mysql

1 year, 11 months ago ShahidMahmud 3 |

copy
6
0
Save to a read only file in vi:w !sudo tee %when you forget to open the file as root

1 year, 11 months ago MikeJudge 4 |

copy
18
0
Find all files larger than 100M on the systemfind / -size +100M -lsSearches / to find all large files on the system and display info about them

2 years ago george 4 |

0
0
Cats

brittanyjacobus 1 year, 10 months ago

-1
htrhNone

gwrgegeg 2 years, 5 months ago

1
WPA-EAP config that uses peaplabelWPA-RADIUS/EAP-PEAP/MSCHAPv2 with RADIUS servers that use old peaplabel (e.g., Funk Odyssey and SBR, Meetinghouse Aegis, Interlink RAD-Series)

gitweb 2 years, 6 months ago

0
WPA PSK with WPA-Enterprise basic configWPA-Personal (PSK) as home network and WPA-Enterprise with EAP-TLS as work network.

gitweb 2 years, 6 months ago

0
how to get the bluetooth profiles listed
bluetooth profiles listing

4 weeks, 1 day ago Shweta 0

0
DDWRT Ifconfig
Hello I've run an ifconfig settings but everytime I reboot the unit the command applied is reset. how can I write the settings done into the non volatile memory of the device? thanks you

9 months, 3 weeks ago dpignataro 0

0
mx-x+my+ax+ay-y

2 years, 2 months ago kuku 0

0
2 log b=log(1+ac)

pls
2 years, 5 months ago nilaxmi 0

0
How can i use mcopy command to replace untranslatable charachet in a file with '?'
Can someone give me example of mcopy -T command in unix. And is it possible to replace the untranslatable character to some other character explicitly.

-T
2 years, 5 months ago chicharito 0

0
How can i use mcopy command to replace untranslatable charachet in a file with '?'
Can someone give me example of mcopy -T command in unix. And is it possible to replace the untranslatable character to some other character explicitly.

-T
2 years, 5 months ago chicharito 0

5
How do i generate ssh keys
What is the easiest way to generate ssh keys?

ssh
2 years, 7 months ago spids82 0