What do you want to save?
Add Code snippet
New code examples
-
C++ 2022-02-28 05:55:16
append string c++
// appending to string #include <iostream> #include <string> int main () { std::string str; std::string str2="Writing "; std::string str3="print 10 and then 5 more"; // used in the same order as described above: ... Add solution -
Shell/Bash 2022-02-28 00:50:25
login to linux server from windows putty
The server’s host key is not cached in the registry. You have no guarantee that the server is the computer you think it is. The server’s rsa2 key fingerprint is: <string>. If you trust this host, hit **Yes** to add the key to PuTTY&rsquo... Add solution -
Python 2022-02-27 22:15:07
OrederedDict
import collections #dictionnarry that remembers the order in which the items where given print 'Regular dictionary:' d = {} d['a'] = 'A' d['b'] = 'B' d['c'] = 'C' d['d'] = 'D' d['e'] = 'E' for k, v in d.items(): print k, v print '\nOrderedDict:' d =... Add solution -
Shell/Bash 2022-02-27 08:05:02
find php files not used for x days
# /opt/script/delete-old-folders.sh #!/bin/bash prev_count=0 fpath=/var/log/app/app_log.* find $fpath -type d -mtime +10 -exec ls -ltrh {} \; > /tmp/folder.out find $fpath -type d -mtime +10 -exec rm -rf {} \; count=$(cat /tmp/folder.out | wc -l) if... Add solution -
Python 2022-02-26 22:10:05
python rsa
import Crypto from Crypto.PublicKey import RSA from Crypto import Random random_generator = Random.new().read key = RSA.generate(1024, random_generator) #generate public and private keys publickey = key.publickey # pub key export for exchange encrypted... Add solution