قرآن در کامپیوتر

دانلود نرم افزار های قرآنی یه صورت رایگان

قرآن در کامپیوتر

دانلود نرم افزار های قرآنی یه صورت رایگان

tincker board init

first update os

sudo apt-get update

and install mysql

sudo apt-get install mysql-server
and create ssh user
adduser username 
and add sudo this user
usermod -aG sudo username 

for connect this user with ssh
Edit (as root) /etc/ssh/sshd_config. Append the following to it: 
PermitRootLogin no

and restart sshd service
systemctl restart sshd

and connect to board by ssh
create mysql user 

CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';


and create database

create database <database_name> character set UTF8 collate utf8_bin
CREATE DATABASE mydatabase CHARACTER SET utf8 COLLATE utf8_general_ci;


armbian - سیستم عامل برای پردازنده های ARM

سیستم عامل برای پردازنده های ARM


برای شروع میتوان از سند زیر کمک گرفت:

https://docs.armbian.com/User-Guide_Getting-Started


برای دانلود به این صفحه رفته و Armbian Stretch را دانلود کنید:

https://www.armbian.com/tinkerboard

https://dl.armbian.com/tinkerboard/Debian_stretch_next.7z


نام کاربری و کلمه عبور پیش فرض 

username: root

password: 1234

برای اتصال به شبکه وایرلس میتوان از دستور زیر استفاده کرد:

nmtui-connect


برای مانیتور کردن دما و پردازنده میتوان از دستور زیر استفاده کرد:

armbianmonitor -m


قبل از هر کاری ابتدا باید مخزن برنامه ها را بروز کرد تا بتوان بسته ها را نصب کنیم

برای این کار از دستورهای زیر استفاده میکنیم

apt update

apt upgrate


سپس میتوان بسته های زیر ر ا نصب کرد

apt install mysql-server

apt install openjdk-8-jdk


برای ساخت پایگاه داده میتوان از دستور زیر استفاده کرد

CREATE DATABASE mydatabase CHARACTER SET utf8 COLLATE utf8_general_ci;
برای ایجاد حساب کاربری برای پایگاه داده میتوان از دستور زیر استفاده کرد

GRANT ALL PRIVILEGES ON mydatabase.* TO 'parking'@'localhost' IDENTIFIED BY 'password';

برای اجرای یک دستور هنگام روشن شدن ماشین میتوان دستور مورد نظر را در فایل زیر قرار داد
/etc/rc.local
به طور مثال میتوان دستور زیر را برای اجرای برنامه جاوا در پس زمینه استفاده کرد
nohup java -jar panel.war &

ssl in rest template

TrustStrategy acceptingTrustStrategy = (X509Certificate[] chain, String authType) -> true;
SSLContext sslContext = org.apache.http.ssl.SSLContexts.custom()
.loadTrustMaterial(null, acceptingTrustStrategy)
.build();

SSLConnectionSocketFactory csf = new SSLConnectionSocketFactory(sslContext);
CloseableHttpClient httpClient = HttpClients.custom()
.setSSLSocketFactory(csf)
.build();

HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory();
requestFactory.setHttpClient(httpClient);


RestTemplate restTemplate = new RestTemplate(requestFactory);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);

MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
map.add("param1", param1);
map.add("param2", param2);
map.add("param3", param3);

HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(map, headers);
ResponseEntity<String> response = restTemplate.postForEntity("https://url", request, String.class);

//


ssh server config


------------------ disable timeout
/etc/ssh/sshd_config
ClientAliveInterval
120
ClientAliveCountMax 720

--------------------------- static ip

ip link show

nano/etc/network/interfaces



auto enp0s3

iface enp0s3 inet static

address 192.168.1.10

netmask 255.255.255.0

gateway 192.168.1.1

dns-nameservers 8.8.8.8 8.8.4.4

How to tunnel Internet traffic over SSH in Windows

 setting up the SSH connection

  • You need an SSH client. For Windows I recommend the free (libre) GUI client PuTTY with lots of features, including the ones we will need. PuTTY will be used for the rest of this section.
  • Run PuTTY. It starts in the "Session" screen; fill in the settings for your SSH connection. The fields "Host Name" and "Port" are pretty self-explanatory. You can enter the username too by filling the "Host Name" field in the "user@host" format. Make sure "SSH" is selected in "Connection type:".
  • Go to the "Connection" -> "SSH" -> "Tunnels" screen to configure our tunnel.
    • Under "Add new forwarded port:", enter some big integer of your choice to enter for the "Source port" field. (The first thousand or so ports are sometimes reserved by the operating system; so pick something bigger.) Here I will use arbitrarily choose 1080 (the SOCKS port).
    • Leave the "Destination" field blank.
    • Select the "Dynamic" radio button.
    • Click the "Add" button. You should see a line in the text box that reads "D1080" (or whatever number you chose).
    • (For those interested, this is the "-D" option in OpenSSH.)
  • (Optional:) By default the a login session is opened in the terminal, which usually runs a "shell", allowing you to run commands on the command line on the remote computer. If you absolutely do not wish to use this, you may be able to disable it via the following:
    • Go to the "Connection" -> "SSH" screen.
    • Check the "Don't start a shell or command at all" box.
    • (For those interested, this is the "-N" option in OpenSSH.)
  • (Optional:) At this point, it is a good idea to create a saved session, so you do not have to go through this process every time. If you wish to do so, go back to the "Session" screen; enter a name for the session and click "Save".
  • Now you can open the connection. Click the "Open" button at the bottom.
  • The session window will open. If this is your first time connecting, it will ask you to add the key; "yes" is recommended. Enter the password when prompted. (You may also set it up to authenticate using public key instead of password, but that is beyond the scope of this tutorial.)
  • The login session is now connected. As long as the session is open, you will now have a SOCKS proxy running on on the local computer (localhost) at port 1080 (or whatever port you chose).



Example: Mozilla Firefox browser

  • Go to "Tools" menu -> "Options"
  • Go to "Advanced" screen -> "Network" tab
  • In the "Connection" section, click the "Settings..." button
  • Select the "Manual proxy configuration" radio button
  • Make sure "Use this proxy server for all protocols" is unchecked
  • Make sure the "HTTP Proxy", "SSL Proxy", "FTP Proxy", "Gopher Proxy" fields are cleared
  • For "SOCKS Host", enter "127.0.0.1", and for "Port" enter 1080 (or whatever port you chose)
  • Select the "SOCKS v5" radio button
  • Click OK. Click OK.
  • Preventing DNS leaks is supported in Firefox 1.5.0.2 and above. Do the following:
    • Go to the URL "about:config"
    • Find the setting "network.proxy.socks_remote_dns" and set it to "true"


https://www.ocf.berkeley.edu/~xuanluo/sshproxywin.html

JPA Repositories

 Supported keywords inside method names

KeywordSampleJPQL snippet
AndfindByLastnameAndFirstname… where x.lastname = ?1 and x.firstname = ?2
OrfindByLastnameOrFirstname… where x.lastname = ?1 or x.firstname = ?2
BetweenfindByStartDateBetween… where x.startDate between 1? and ?2
LessThanfindByAgeLessThan… where x.age < ?1
GreaterThanfindByAgeGreaterThan… where x.age > ?1
AfterfindByStartDateAfter… where x.startDate > ?1
BeforefindByStartDateBefore… where x.startDate < ?1
IsNullfindByAgeIsNull… where x.age is null
IsNotNull,NotNullfindByAge(Is)NotNull… where x.age not null
LikefindByFirstnameLike… where x.firstname like ?1
NotLikefindByFirstnameNotLike… where x.firstname not like ?1
StartingWithfindByFirstnameStartingWith… where x.firstname like ?1 (parameter bound with appended %)
EndingWithfindByFirstnameEndingWith… where x.firstname like ?1 (parameter bound with prepended %)
ContainingfindByFirstnameContaining… where x.firstname like ?1 (parameter bound wrapped in %)
OrderByfindByAgeOrderByLastnameDesc… where x.age = ?1 order by x.lastname desc
NotfindByLastnameNot… where x.lastname <> ?1
InfindByAgeIn(Collection<Age> ages)… where x.age in ?1
NotInfindByAgeNotIn(Collection<Age> age)… where x.age not in ?1
TruefindByActiveTrue()… where x.active = true
FalsefindByActiveFalse()… where x.active = false


http://docs.spring.io/spring-data/jpa/docs/1.4.1.RELEASE/reference/html/jpa.repositories.html

دستورات ساده اما مفید در راه اندازی یک سرور لینوکس

حذف یک پوشه با زیر پوشه های آن
rm -rf directoryname
نمایش شناسه های پردازه های در حال اجرای جاوا
ps -A |grep java
حذف پردازه بر اساس شناسه آن (PID)
kill -9 PID
ساخت یک پوشه جدید
mkdir folderName
درخواست http در خط فرمان
curl http://example.com
ساخت فایل متنی
cat > index.html

چند وب سایت در یک tomcat

در پوشه config در فایل server.xml به ازای هر یک از app ها یکی از این ها رو قرار دهید تا هر دامنه ای به پوشه مورد نظر ارتباط داده شود.


<Host name="<<domain.ir>>" appBase="webapps" unpackWARs="true" autoDeploy="true">
        <Alias><<www.domain.ir>></Alias>
        <Context path="" docBase="<<your_folder_name>>" debug="0" privileged="true" />
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
            prefix="<<appName>>_access_log." suffix=".txt"
            pattern="%h %l %u %t &quot;%r&quot; %s %b" resolveHosts="false"
        />
    </Host>


خطهای آبی رو پاک کنید و تنظیمات خودتون رو قرار بدید

راه اندازی یک DNS Server

برای راه اندازی یک DNS Server بر روی CentOS مراحل زیر را انجام میدهیم


yum install bind* -y

rndc-confgen


########################################

edit: /etc/named


options {
    directory     "/var/named";
    dump-file     "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
    recursion yes;

    dnssec-enable yes;
    dnssec-validation yes;

    /* Path to ISC DLV key */
    bindkeys-file "/etc/named.iscdlv.key";

    managed-keys-directory "/var/named/dynamic";
};


################################

edit /etc/named*.zones


zone "domain1.ir" IN {
    type master;
    file "/var/named/zones/db.domain1.ir.txt";
    allow-transfer { none; };
};

zone "domain1.com" IN {
    type master;
    file "/var/named/zones/db.domain1.com.txt";
    allow-transfer { none; };
};


######################

create file in: /var/named/zones/db.domain1.com.txt


$TTL 6h
@    IN SOA    ns1.domain1.com. ns2.domain1.com. (
            2015081101
            10800
            3600
            604800
            86400 )

@        NS    ns1.domain1.com.


ns1    IN A    12.92.144.103
www    IN A    12.92.144.103
@    IN A    12.92.144.103

راه اندازی یک yeoman

فقط کافیه که از github دانلودش کنید، بعد از اینکه دانلود کردید برید تو پوشه اش بعد این رو بزنید.

npm link

بعد از این میتونید به راهتی با استفاده از دستور زیر ازش استفاده کنید

yo [name]