Skip to main content

Posts

SystemD commands

Recent posts

How to share windows folder to linux machine

In windows machine under network settings *Turn on network discovery * Turn on print and share Click on share the folder you need * Make sure in advanced option Everyone is added * Make sure full control is given to Everyone in security Tab In linux install cifs rahul@rahul-Inspiron-3542:~$ sudo apt-get install cifs-utils root@rahul-Inspiron-3542:~# sudo mount.cifs //DESKTOP-MN0NNMU/CentOS-7-x86_64-Everything-1611 ./test   -o user=reachvishnu@outlook.in sec=ntlmsspi Password for reachvishnu@outlook.in@//DESKTOP-MN0NNMU/CentOS-7-x86_64-Everything-1611:  ******** *Note new windows machine probably doesn't have local user and group. Under control panel user account management check the user name in the format user@email.

Windows admin commands

1) shutdown Shut Down: shutdown /s /t 0 Restart: shutdown /r /t 0 Restart Into Startup Options: shutdown /r /o 2) recimg – Create Custom Recovery Images     recimg /createimage path 3)  sfc /scannow – Scan System Files for Problems 4) netstat -an – List Network Connections and Ports 5)Find the five processes using the most memory (Power shell) ps | sort –p ws | select –last 5 6)Cycle a service (stop, and then restart it) like DHCP -- (Power shell) Restart-Service DHCP 7) Search a string in current path  (Power shell) dir -r  | select-string stringname 8) To get the system info and summary net statistics server/workstatition -uptime info C:\Users\vishnu>systeminfo | more Host Name:                 DESKTOP-JGGFDUJ OS Name:                   Microsoft Windows 10 Pro OS Version:                10.0.10586 N/A Build 10586 OS Manufacturer:           Microsoft Corporation OS Configuration:          Standalone Workstation OS Build Type:             Multip

SQLITE commands

 Create a database with the name rahultest rahul@rahul-Inspiron-3542:~$ sqlite3 rahultest.db SQLite version 3.8.11.1 2015-07-29 20:00:57 Enter ".help" for usage hints. ========================================= Show the databases sqlite> .databases seq  name             file                                                     ---  ---------------  ---------------------------------------------------------- 0    main             /home/rahul/rahultest.db                                 sqlite> sqlite> ======================================= Commit rollback and release creating a save point sqlite> savepoint starter; sqlite> sqlite> create table test (int ); sqlite> .tables test sqlite> sqlite> rollback to savepoint starter; sqlite> .tables sqlite> create table test (int ); sqlite> .tables test sqlite> release savepoint starter; sqlite> .tables test sqlite>.quit Taking bac

POSTGRES COMMANDS

1. Create your own database on provided server. Name it DB_yourname.    postgres=# create user db_rahul with password 'abcd'; CREATE ROLE postgres=# postgres=# postgres=# create database db_rahul with owner db_rahul; CREATE DATABASE postgres=#   2. Create table, where you have 3 columns: 'ID', 'Name', 'Organization', 'department' Fill in this table with data - create 3 records.      postgres=# \c db_rahul You are now connected to database "db_rahul" as user "postgres". db_rahul=# create table customer ( id int not null, db_rahul(# name text not null, db_rahul(# organization text not null, db_rahul(# department text not null ); CREATE TABLE db_rahul=# insert into customer (id,name,organization,department) values (1,'rahul','datacom','Cloud'); INSERT 0 1 db_rahul=# insert into customer (id,name,organization,department) values (2,'vishnu','datacom','Cloud'); INSERT 0 1

Budget calculator in Python

Today we friends have faced trouble when making tally of  the amount we have paid for the new flat advance, the amount company provided, the money given to broker. So planned to make a budget calculator names=[] def fun(numbers):            while True:                      x=raw_input("if done enter stop:   ")                      numbers.append(x)                      if x == 'stop':                                    break            return numbers def func_sum(a,b,c):                   for i in range(0,b):                                              x=a[i]                                              print "Enter the calculation of %s" % x                                              y=eval(raw_input("Enter  "))                                              z = c - float(y)                                              print "The amount to be paid by /should be paid to if negative.... %s is %r" % (x,z)                            

Create a custom linux shell with limited customized commands

Here is a c Program I have tried to create  a custom shell in linux with limited commands #include #include #include #include #include using namespace std; int main(int argc, char * argv[]) {   string command; cout << "\t This is a custom developed shell \n\n"; while (command != "myexit") { if ( command == "myexit") system("exit"); else if ( command == "myfinger" ) { char username[40]; char buf[32]; printf ("Enter the username:\n"); scanf ("%s",&username); sprintf(buf, "finger %s", username); system (buf); } else if ( command == "mydel" ) { char filename[40]; char cmd1[40]; printf ("Enter the filename to delete:\n"); scanf ("%s",&filename); sprintf(cmd1, "rm -rf %s", filename); system (cmd1); printf ("The file %s deleted \n", filename); } else if ( command == "mywhich" ) { char cmmnd[40]; char cmd2[40]; printf ("Enter the c