Forgot your MySQL Password? No worries

Posted: 26th July 2013 by Jab in Server
Tags: ,

Step 1 – Stop mysql service
# /etc/init.d/mysql stop
You should see something like this
Stopping MySQL database server: mysqld.

Step 2 – Start MySQL server with out password
# mysqld_safe --skip-grant-tables &
You can also run
service mysql start --skip-grant-tables
You should see something like this
Starting MySQL.. SUCCESS!

Step 3 – Connect to mysql server using root user
# mysql -u root

You will see something like this
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 5.1.55-MariaDB-mariadb98 (MariaDB - http://mariadb.com/)

This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]>

Step 4 – Set up new MySQL password for the root user
MariaDB [(none)]> use mysql;
MariaDB [mysql]> update user set password=PASSWORD("9nji77~") where User='root';
MariaDB [mysql]> flush privileges;
MariaDB [mysql]> quit

Step 5 – Stop MySQL Server
# /etc/init.d/mysql stop
You should see something like this
Stopping MySQL database server: mysqld.

Step 6 – Start MySQL Server and test

How to save a SnapChat image or video

Posted: 2nd June 2013 by Jab in Casual, Useless Info

So you have this cool app called SnapChat – and you get clips all day long of cute pictures and funny videos – and within seconds its gone. Never to be found again. Or is it?  With a little digging and a some hacking – I believe to have found a clue on Android at least.

This will require your phone be ‘rooted’ if you don’t know what that is – this may be too advanced for you – google it – then come back.

You will need a Android App called SSHDroid – it is free ‘with ads’ but still will work –
You will need a Mac / Linux or PuTTY (Win) and a Terminal Opened
You will need a folder on your extSdCard to store the SnapChats

Download SSHDroid from Google Play and open after it has installed.

It will give you an IP address that you can use to connect to via SSH in my case
ssh root@192.168.1.113

After you connect it tells you the default root password .. simply enter this info in .. and .. … you are connected to your Android Phone via SSH

Now you will need to do 1 thing first before you start hacking away to find where these SnapChats are located. So here is some education … Directly from SnapChat

When someone sends a snap, it is uploaded to our servers, the recipient(s) are sent a notification that they have a new snap and the Snapchat app downloads a copy of the message. The image or video from the message is stored in a temporary folder in the device’s memory. This is sometimes in internal memory, RAM or external memory like an SD Card—depending on the platform and whether it’s a video or a picture.

 And furthermore
While an unopened snap is being stored on the device, it’s not impossible to circumvent the Snapchat app and access the files directly. This isn’t something we support or encourage and in most cases it would involve jailbreaking or “rooting” the phone and voiding its warranty. If you’re trying to save a snap, it would be easier (and safer) to just take a screenshot or take a picture with another camera.

With that being said .. as you can see .. yes .. the Snaps are stored locally to your device temporarily until you decide to open them and then they disappear forever.

Now for the fun part …

So you got a notification you got a new SnapChat – Well lets open that App right up – and DO NOT CLICK ON ANY SNAPS – just leave them in there .. we want them to dl to your phone in that ‘temporary’ folder remember.

Next back to your terminal window.
cd /data/data/com.snapchat.android/cache/received_image_snaps

This is the ‘temporary’ directory in which your snaps are stored.
Doing a ls on the directory you get something like this

-rw------- 1 u0_a211 u0_a211 66682 Jun 2 22:28 h1a81hurcs00h1372307294812.jpg.nomedia
-rw------- 1 u0_a211 u0_a211 13570 Jun 2 00:16 h1a81hurcs00h1372313771871.jpg.nomedia
-rw------- 1 u0_a211 u0_a211 66682 Jun 22 00:16 h1a81hurcs00h1372313772277.jpg.nomedia

Notice they end in .nomedia –

Next you can copy them to a more remote location for your viewing pleasure – or storage.
If you haven’t already .. create a folder on your extSdCard – I called mine Snapchat – you can do this with your file browser on your phone

Now lets copy these files out of here and into your remote location in /storage/extSdCard/Snapshat

cp h1a81hurcs00h1372313771871.jpg.nomedia /storage/extSdCard/Snapchat/

Once those files have been copied – you can then cd to that directory and ‘rename’ the files

cd /storage/extSdCard/Snapchat
mv h1a81hurcs00h1372313771871.jpg.nomedia picture1.jpg

‘mv’ is the universal command to rename a file in unix. Plus if you noticed I just renamed it to whatever I wanted ‘.jpg’ .. if you do not take off the .nomedia you will not be able to view what it is.

So now that you have moved the files that were in the ‘temporary’ folder you can then go back to SnapChat and view your snaps. You can then use your File Browser on your phone and navigate to the folder where you copied your Snaps and then renamed them, and they will be there forever.

Removing Activation

Posted: 21st April 2013 by Jab in Casual

Microsoft has released an update to Windows 7 Activation Technologies (KB971033), which improves its effectiveness and success rate to detect more than 70 known and potentially dangerous activation bypasses, cracks or exploits.

For Windows 7 users who are using counterfeit or pirated copies of Windows 7 on the machine, the KB971033 can potentially causing havoc to the computer system, including frequent and persistent nag message on screen to remind users to go genuine.
For non-genuine or illegal copy Windows 7 users, the best and recommended approach is not to install KB970133 update, which delivers that WATu (WAT update). For user who has installed the KB970133, here’s the guide to remove and uninstall the KB970133 update package, as the KB970133 is not an mandatory update. The procedure is similar to how any updates and hotfixes can be removed.
  1. Go to Control Panel -> Programs -> Programs and Features -> Uninstall a program.
  2. Click on the View Installed Updates on the left pane.
  3. Select and highlight the Update for Microsoft Windows (KB971033).
  4. Click on Uninstall.
  5. The K971033 will be deleted from the system.
The package can also be uninstalled through elevated command prompt with administrator privileges:
x86 (32-bit) system:
dism /online /remove-package /PackageName:Microsoft-Windows-Security-WindowsActivationTechnologies-Package~31bf3856ad364e35~x86~~7.1.7600.16395
x64 (64-bit) system:
dism /online /remove-package /PackageName:Microsoft-Windows-Security-WindowsActivationTechnologies-Package~31bf3856ad364e35~amd64~~7.1.7600.16395
Note that even your system has been flagged as non-genuine, removing the KB971033 WAT update won’t make the system genuine again. The best workaround for non-genuine system is to remove any crack, hack or loader that been the source of being flagged by WATu, then perform a rearm (reset the remaining rearm count if all rearms allowed is been used up or depleted). If you have a valid and legitimate product key, change the product key. Then, perform a force validation re-check to validate the system again by running the following command in elevated command prompt with administrator rights:
%SystemRoot%\system32\Wat\WatAdminSvc.exe /run
Validation takes 2-5 minutes to complete, and you may have to log out or reboot for all nags to disappear.
Other alternative is to do a system restore to a restore point prior to KB971033 been installed. Or, simply remove the failed crack or loader, and install a new crack or OEM BIOS loader for Windows 7which works, and then re-validate the system with command above.
Anyway, Windows 7 SP1 is going to include KB971033 by default. By then, KB971033 WAT update is unlikely to be separable nor uninstallable. However, users can choose to disable WATu files without uninstalling with the following command (run in elevated command prompt with administrator privileges):
takeown /f "%windir%\System32\Wat\*" && icacls "%windir%\System32\Wat\*" /deny *S-1-1-0:F
And, delete the scheduled tasks used by WAT to run validation checks. WATu uses Task Shedualer to validate the system right after reboot when first installed and again every 90 days. To disable the associated tasks, run the following commands in elevated command prompt with administrator rights:
schtasks /change /disable /tn "\Microsoft\Windows\Windows Activation Technologies\ValidationTask" && schtasks /change /disable /tn "\Microsoft\Windows\Windows Activation Technologies\ValidationTaskDeadline"

Installing Java 7 on Ubuntu 12.04

Posted: 27th March 2013 by Jab in Server, Ubuntu

Installing Java on Ubuntu 12.04 – to the novice can be a not so easy task .. but thanks to my installs of this OS on my server I believe I have it down pat .. here is what I do .. and this should work for you as well ..

First you just want to make sure you are up to date

$ sudo apt-get update

Next

$ sudo apt-get upgrade

Next we will install python-software-properties
This software provides an abstraction of the used apt repositories. It allows you to easily manage your distribution and independent software vendor software sources.

$ sudo apt-get install python-software-properties

 

Now that this is installed we can install the repositories needed to install Oracle Sun Java

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java7-installer

 

You can also install JDK

$ sudo apt-get install openjdk-7-jre

 

Questions, Comments, Concerns – Leave them in the comments

~Jab

Server back online again!

Posted: 27th March 2013 by Jab in Minecraft, Server, Web Design

Server went down again – not sure why .. so I completely de-banned the harddrives making sure nothing on them was causing any issues – ran a fsck on the drives all turned out well – s0 .. I put on Ubuntu back on Server 12.04 LTS – and starting to put everything back on –

The server is Intel Xeon E5645 2.40GHz with only 8gb ram .. looking to update to 64 when I get the cash – and maybe adding an additional E5645 to make it a dual CPU .. but its a 6core chip .. so it works great for what I need for now.

Got 2 300gb hd in raid 0 and 2 external drives just for added storage. totaling about 1TB total for the server.

This will be used for hosting most of my sites – and the minecraft servers –
Sites will be hosted from the main host while the Minecraft servers will be up on Virtual Servers. I have done this before and they work well .. but will need testing later on. So if you are reading this and want to join some Minecraft servers hop on. There will be a misture of Vanilla, Bukkit, Feed the Beast, and more .. I will update this post as I add them. Hosting them for free YES indeed .. however donations are always welcome.

One of the Minecraft servers will be at chicken.servemycraft.com – 4 core / 1gb ram / 25gb HD space – I will be adding more servers later with more ram / hd / and cores. This server will accommodate 1 – 10 players.

The main site servemycraft.com will be primarily used as a guide for Minecraft – I know there are 100’s out there but I like to design and well thats what it will be used for. There will also be tutorials / or How to’s for those that get stuck. Props will go to the sites I get my info from and link backs as well.

Questions, Comments, Concerns – leave them in the comments section and I will get back to you.

~Jab

Pastebin setup

Posted: 14th March 2013 by Jab in Casual

So I been playin around – Set up the new Web Server finally .. think its gonna stay up this time .. lol

So far have a friends site up there – http://saidnooneever.net 

I also installed a pastebin application php-pastebin located at pb.adiquet.com fell free to use it

 

Server Setup

Posted: 6th March 2013 by Jab in Server

Setting up Coloc

Installed programs –

ZNC – Used for IRC Client

Virtualization with KVM – For adding Virtual Machines

Added Java – sudo apt-get install openjdk-6-jre

Added Subsonic Music Application Subsonic.org

Added new Virtual Machine of 25gb for Minecraft

  • Installed Java –  sudo apt-get install openjdk-6-jre
  • Installed Bukkit Server
  • Installed Essentials, Vault, Citizens plugins

 

 

Cauliflower Pizza

Posted: 2nd March 2013 by Jab in Medifast, Weight Loss

So I tried out the Cauliflower Pizza Crust from Sandys Kitchen Adventures you can find it here.

However I wasn’t too keen on using Cheese in my meals as I want to lose the weight and cheese is my downfall – Hence why I love the new Macaroni & Cheese.

So I have slightly modified the recipe and I will test it out tonight and see how it works .. here is what I will be trying ..

CRUST:
1 cup Grated (Raw) Cauliflower – (2 Greens)
1/4 cup Egg Beaters – (1/8 lean) – 2 cups is a full lean
1/8 tsp garlic powder – (1/2 condiment)
1/4 tsp basil – (1/4 condiment)

TOPPINGS:
1/4 cup tomatoes – pureed (1/2 green)
1/4 cup jalapenos / red peppers (1/2 green)
4.375 oz of lean Steak (7/8 lean)

DIRECTIONS:
Preheat over to 425 – User parchment paper on a cookie sheet for best results – you can spray it slightly with non stick spray.

In a large bowl combine grated cauliflower, egg beaters, garlic and basil and mix completely.  Spread mixture onto parchment paper spreading out evenly with a spoon. The thinner you make it the the better change it will not be soggy – as cauliflower does have lots of water.
image

image

Bake in the over for about 30 minutes – using a spatula go around the edges to lift from pan and flip very carefully. Bake for an additional 15 minutes.  You may see that it will look burnt – not to worry it does not taste burnt.
image

Add puree tomatoes and top with jalapenos / red peppers and steak – put back in over on broil for about 5 – 10 minutes.

image

Enjoy  – I will post pictures later.

Install New Server

Posted: 18th February 2013 by Jab in Casual

Setting up a new server with Apache, Mysql, PHP and some goodies

Install MySQL, phpMyAdmin, rkhunter, binutils

apt-get install mysql-client mysql-server openssl getmail4 rkhunter binutils

New password for the MySQL “root” user: <– yourrootsqlpassword
Repeat password for the MySQL “root” user: <– yourrootsqlpassword

We want MySQL to listen on all interfaces, not just localhost, therefore we edit /etc/mysql/my.cnf and comment out the line bind-address = 127.0.0.1:

 

vi /etc/mysql/my.cnf

[...]
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address           = 127.0.0.1
[...]

Then we restart MySQL:
/etc/init.d/mysql restart

Now check that networking is enabled. Run
netstat -tap | grep mysql

Install Apache2, PHP5, phpMyAdmin, FCGI, suExec, Pear, And mcrypt

Apache2, PHP5, phpMyAdmin, FCGI, suExec, Pear, and mcrypt can be installed as follows:

apt-get install apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2-mod-php5 php5 php5-common php5-gd php5-mysql php5-imap phpmyadmin php5-cli php5-cgi php5-curl libapache2-mod-fcgid apache2-suexec php-pear php-auth php5-mcrypt mcrypt php5-imagick imagemagick libapache2-mod-suphp libruby libapache2-mod-ruby libapache2-mod-python libapache2-mod-perl2

You will see the following question:

Web server to reconfigure automatically: <– apache2
Configure database for phpmyadmin with dbconfig-common? <– No

Restart Apache afterwards:
/etc/init.d/apache2 restart

Xcache

Xcache is a free and open PHP opcode cacher for caching and optimizing PHP intermediate code. It’s similar to other PHP opcode cachers, such as eAccelerator and APC. It is strongly recommended to have one of these installed to speed up your PHP page.

Xcache can be installed as follows:
apt-get install php5-xcache

Now restart Apache:
/etc/init.d/apache2 restart

To use PHP-FPM with Apache, we need the mod_fastcgi Apache module (please don’t mix this up with mod_fcgid – they are very similar, but you cannot use PHP-FPM with mod_fcgid). We can install PHP-FPM and mod_fastcgi as follows:

apt-get install libapache2-mod-fastcgi php5-fpm

Make sure you enable the module and restart Apache:
a2enmod actions fastcgi alias
/etc/init.d/apache2 restart

Install PureFTPd

PureFTPd can be installed with the following command:
apt-get install pure-ftpd-common pure-ftpd-mysql

Install Vlogger, Webalizer, And AWstats

Vlogger, webalizer, and AWstats can be installed as follows:

apt-get install vlogger webalizer awstats geoip-database libclass-dbi-mysql-perl

Open /etc/cron.d/awstats afterwards…

vi /etc/cron.d/awstats

… and comment out everything in that file:

#MAILTO=root
#*/10 * * * * www-data [ -x /usr/share/awstats/tools/update.sh ] && /usr/share/awstats/tools/update.sh
# Generate static reports:
#10 03 * * * www-data [ -x /usr/share/awstats/tools/buildstatic.sh ] && /usr/share/awstats/tools/buildstatic.sh

Install fail2ban

apt-get install fail2ban

So you wanna be a hacker

Posted: 16th September 2012 by Jab in Stuff I see at work, Ubuntu
Tags: , , ,

You lose your Windows password(s) and cannot log in to your machine. If you have a rescue disk, you should be okay. If not, you might have to turn to Linux for help.

The method that I describe in this tutorial can work with a Windows machine that either dual boots with Linux or does not. If the machine in question does not dual boot, you will need to download a live edition of a Linux distribution (I prefer Ubuntu for the task) and burn that ISO image to a disk (you could also use a Linux distribution on a USB drive). Either way, you will need to boot in to Linux to recover your password.

Step 1: Boot in to Linux

Put the burned disk in the drive (or boot from USB) and boot in to the Live edition of Linux. You should use the standard Live session.

Step 2: Find the Windows partition

Open Nautilus (the GNOME file manager) and follow these steps:

  1. Hit the Ctrl-L key combination to open the Location bar (Figure A).
  2. Enter the string “computer:///” (no quotes).
  3. Locate the drive (or partition) that contains your Windows installation.
  4. Right-click the Windows drive icon and click Mount.
  5. Double-click the icon to open the Windows drive (or partition) and make note of where the drive is mounted (it will be listed in the location bar).

The drive in question on my system is the far left icon. (Click the image to enlarge.)

Step 3: Get to the command line

It’s time to open a terminal window and begin (or continue) your journey into the Linux command line. You must install the small tool called chntpw. To install this application, issue the command: sudo apt-get install chntpw. With that application installed, you are ready to go. Follow these steps to get the password changed:

  1. Change into the directory containing Windows with the command cd /PATH/TO/WINDOWS (PATH/TO/WINDOWS is the complete directory path to your Windows drive).
  2. Change into the Windows/System32/config directory.
  3. Issue the command sudo chntpw SAM.

You should now see the chntpw screen (Figure B). Here you have five options:

  • Clear user password
  • Edit user password
  • Promote user (make user an administrator)
  • Unlock and enable user account
  • Quit

Figure B

You do not want to make changes here, because this could wipe all users’ passwords — make sure you are working with a specific user. (Click the image to enlarge.)

Enter “q” for quit. We’re going to make sure we are working with a specific user. To list out all users in the SAM file, issue the command sudo chntpw -l SAM. This will list out all of the users on the system. As you can see in Figure C, my name is listed as one of the users. Figure C

This listing will also tell you how many failed login attempts have been made. (Click the image to enlarge.)

To work with a specific user, issue the command sudo chntpw -u “USER NAME” SAM (USER NAME is the actual username). If the username is only one word, you will not need the quotes. If the username is a full name, place it within quotes or the command will not work. Once you are back in the edit screen, do the following:

  1. Type “2” (no quotes) to go into edit mode.
  2. Type the new user password.
  3. Hit the Enter key.
  4. Type “y” (no quotes) followed by Enter to write the file.

Your Windows User password should be changed. Reboot into Windows to make sure the edit worked. If it did not work, go through the steps once again and, this time, blank the password instead of editing it. To blank the password, do the following:

  1. Enter the edit screen for the specific user.
  2. Type “1” (no quotes).
  3. Hit Enter.
  4. Type “y” (no quotes).
  5. Hit Enter.

At this point the user account should have no password. You can reset the password once you successfully log in to Windows.

Source: https://www.techrepublic.com/blog/tr-dojo/reset-windows-passwords-with-the-help-of-linux/