VarjuOrg

Linux / Windows – what’s the difference…

Nifty feature to change text inside large file over Linux commandline

sed -i 's/original/new/g' file.txt sed = Stream EDitor -i = in-place (i.e. save back to the original file) s = the substitute command original = a regular expression describing the word to replace (or just the word itself) new = the text to replace it with g = global (i.e. replace all and not just […]

Letsencrypt on Ubuntu 16.04 LAMP howto commandline

1. Install Letsencrypt with apache addon: sudo apt-get install python-letsencrypt-apache 2. Generate only cert for domain letsencrypt –apache certonly If above fails: 1. For different webroot letsencrypt certonly -a webroot –webroot-path=/var/www/ -d your.domain.name 2. If apache fails or port 443 fails – do manual over HTTP letsencrypt certonly –standalone-supported-challenges http-01 NB! Apache needs fullkeychain and […]

Restoring MySQL root user privileges when corrupt (in linux)

1. On commandline (shut down mysql and start mysqld_safe without grant tables): sudo /etc/init.d/mysql stop sudo mysqld_safe –skip-grant-tables & 2. On new terminal window (log on and execute code as shown): mysql UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='root'; FLUSH PRIVILEGES; GRANT ALL ON *.* TO 'root'@'localhost'; FLUSH PRIVILEGES; 3. Kill mysqld_safe instance 4. Log […]

, , , ,

Kuidas kasutada Windows OS’is DIG’i

DIG käsud ja seletused on leitavad lehelt: http://www.thegeekstuff.com/2012/02/dig-command-examples/ DIG Windowsile on alla laetav BIND paketi osana lehelt: https://www.isc.org/downloads/

Torrentid ja jälgimine

Siinkohal kirjutan enda tarbeks põhiliselt kokkuvõtva teabe P2P võrgu võimalikest “turvavigadest” ja nende “parandamisest”. (Enamus lingid teistele lehtedele või nendel olev teave võib olla natuke vananenud…) Et siis… – enamus inimestest kasutab reeglina P2P networki failide jagamiseks/laadimiseks – suur osa sellest moodustavad torrentid. Viimasel ajal (loe: viimase 3 aasta jooksul) aga on hakatud “tasuta torrent […]

How to reset forgotten WinXP / Win7 / Win8 password and get software serials backup

I’m using 64 bit Win7 Proffessional. 1. You need WinPE disk For that You need:

hg and mercurial on bitbucket – ssh on linux connection problems

FoodForThought: Error: dev$ hg pull remote: Permission denied (publickey). abort: no suitable response from remote hg!

, , ,

IP block from MySQL via iptables

Nifty bash script: #!/bin/bash # 19.09.2013 – Kristjan Tarjus # this script retrieves data from mysql using bash and adds them to iptables for blocking dbase=”YOURDBDATABASE” table=”YOURDBTABLE” host=”YOURDBHOST” user=”YOURDBUSER” dbpass=”YOURDBPASS” #For multiple servers – this script checks via IP function int-ip { /sbin/ifconfig $1 | grep “inet addr” | awk -F: ‘{print $2}’ | awk […]

Mysql on windows and wamp backup and restore

This will create your database “mydb” and restore db_backup.sql from folder: C:\wamp\bin\mysql\mysql5.5.24\bin\ C:\wamp\bin\mysql\mysql5.5.24\bin> mysql -u root -p –default-character-set=utf8 mysql> create database mydb; mysql> use mydb; mysql> source db_backup.sql;

grep ja logid

awk ‘{print $1,$3}’ access.log| grep 192.168.1.1 |sort -u

Previous Posts Next posts